Fetch Sentiments by Ids
The Fetch Sentiments by Ids API fetches the list of sentiments based on the Ids passed. This is a streaming API.
Endpoint
Method: GET
URL: sentiments?t=id-range&ids=id1, id2,…idn
Header Parameter
Authorization Bearer <Token>
Query Parameter
Parameter Name | Mandatory/ Optional | Type | Description |
---|---|---|---|
| Mandatory | string | t represents the type of query. Example: For ids use id-range value. |
| Mandatory | string | A list of ids for which sentiments need to be fetched. The ids are separated by a comma. |
Example Request
curl -H "Authorization: Bearer 911999706310ffbcb32981863e23ce72d5e60d7b" -XGET http://host:port/sentiments?t=id-range&ids=1,2,3,...,n>
Response and Error Codes
Code | Response |
---|---|
200 | A stream of newline separated sentiment documents in the format listed in the above API |
401 | {“reason”:”Authentication failed”} |
422 | {“error”: “Error while decoding response from the database”} |
500 | {“error”: “Internal server error”} |