Rate an article from 1 to 5 based on customer choice
POST
/cms/content/{id}/rate
const url = 'https://api.example.com/cms/content/example/rate';const options = { method: 'POST', headers: { 'API-Key': '<API-Key>', Authorization: 'Bearer <token>', Token: '<Token>', 'Content-Type': 'application/json' }, body: '{"rating":1,"source":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.com/cms/content/example/rate \ --header 'API-Key: <API-Key>' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Token: <Token>' \ --data '{ "rating": 1, "source": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Content ID
Request Bodyrequired
Section titled “Request Bodyrequired”Rating payload
Media typeapplication/json
object
rating
required
Customer rating (1-5)
integer
source
Source of the rating
string
Example generated
{ "rating": 1, "source": "example"}Responses
Section titled “Responses”Rating added
Media typeapplication/json
object
rating
New average score of the content
number format: float
Example generated
{ "rating": 1}