You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,12 @@ This library contains the generated API client and the SSO utilities to make wor
29
29
30
30
### Public vs Secured APIs
31
31
32
-
For the API client, there are two classes, `DefaultApi` and `PublicApi`. The `DefaultApi` contains methods that require your API key, and `PublicApi` contains api calls
33
-
that can be made directly from a browser/mobile device/etc without authentication.
32
+
For the API client, there are three classes, `DefaultApi`, `PublicApi`, and `ModerationApi`. The `DefaultApi` contains methods that require your API key, and `PublicApi` contains api calls
33
+
that can be made directly from a browser/mobile device/etc without authentication. The `ModerationApi` contains the methods that power the moderator dashboard.
34
+
35
+
The `ModerationApi` covers comment moderation (list, count, search, logs, export), moderation actions (remove/restore, flag, set review/spam/approval status, votes, reopen/close thread),
36
+
bans (ban from a comment, undo, pre-ban summaries, ban status/preferences, banned-user counts), and badges & trust (award/remove badge, manual badges, get/set trust factor, user internal profile).
37
+
Each `ModerationApi` method accepts an `sso` parameter so the request can be made on behalf of an SSO-authenticated moderator.
34
38
35
39
## Quick Start
36
40
@@ -91,10 +95,30 @@ rescue FastCommentsClient::ApiError => e
91
95
end
92
96
```
93
97
98
+
### Using Moderation APIs (ModerationApi)
99
+
100
+
The moderation methods power the moderator dashboard. Pass an `sso` token so the request is made on behalf of an SSO-authenticated moderator:
1.**401 "missing-api-key" error**: Make sure you set `config.api_key['x-api-key'] = 'YOUR_KEY'` before creating the DefaultApi instance.
97
-
2.**Wrong API class**: Use `DefaultApi` for server-side authenticated requests, `PublicApi` for client-side/public requests.
121
+
2.**Wrong API class**: Use `DefaultApi` for server-side authenticated requests, `PublicApi` for client-side/public requests, and `ModerationApi` for moderator dashboard requests.
98
122
3.**Null API key**: The SDK will silently skip authentication if the API key is null, leading to 401 errors.
0 commit comments