REST API
There is only one endpoint: /api/rate
.
Params
Language (coming soon)
You can specify the language of the comments to be evaluated through the query paramater "lang". For now only available in English.
https://vibecheck.ouariachi.com/api/rate?lang=english
Comments
You have to send your comments in the body of the application. You can do this in two ways:
1. Array of strings.Request:
[ "This is a good comment.", "Is this a bad comment?" ]
Response:
[
{
"comment": "This is a good comment.",
"rating": 0.6
},
{
"comment": "Is this a bad comment?",
"rating": -0.6
}
]
You can pass an array of objects. This is useful for identifying comments and not relying solely on the content. But, this method requires that your objects have a content
property with the content of the comment.
Request:
[
{
"content": "This is a good comment.",
"user": "Bob",
"id": 1
},
{
"content": "Is this a bad comment?",
"id": 2
}
]
Response:
[
{
"comment": {
"content": "This is a good comment.",
"user": "Bob",
"id": 1
},
"rating": 0.6
},
{
"comment": {
"content": "Is this a bad comment?",
"id": 2
},
"rating": -0.6
}
]