This web service makes it possible to rate an unstructured document.
| Method | Endpoint |
|---|---|
POST |
|
| Path parameter | Type | Description |
|---|---|---|
{docId} |
String | Expects the id associated with the document. Users can get the id by listing documents or searching documents. |
- This web service is available to both authenticated and unauthenticated users with the
RATING_USERrole. - It is necessary to provide an
Ft-Calling-Appvalue when using Fluid Topics web services. See Fluid Topics calling app. - Unauthenticated ratings and ratings using an API key only show in the ratings analytics.
This web service requires authentication on portals with mandatory authentication.
Request example
The following example shows a JSON request body for this web service:
{
"type": "STARS",
"value": 1
}
| Field | Type | Required? | Description |
|---|---|---|---|
type |
String | Yes | The types of ratings an administrator has enabled for this document. Accepted values are STARS, LIKE, DICHOTOMOUS, and NO_RATING. |
value |
Number | Yes | The rating's value. Rating values depend on rating types (STARS: 1 to 5, LIKE: 0 or 1, DICHOTOMOUS: 0 or 1). |
| Return code | Description |
|---|---|
201 CREATED |
The rating was taken into account. |
401 UNAUTHORIZED |
The authorization header is absent or invalid and the portal's configuration does not allow unauthenticated users to rate content. |
403 FORBIDDEN |
The user or API key does not have the RATING_USER role. |
404 NOT FOUND |
No document exists with this identifier. |
For a comprehensive list of all possible return codes, see Return codes.