API – Adding bonuses to users
Use АРI token for authorization. Details in the article API token
- To add bonuses, you need to send a POST request to the URI https://your-domain.davintoo.com/api/v2/gift-store/report/add-bonuses
- The body of the request must contain a JSON object with the id of the users to whom bonuses need to be assigned, and the number of bonuses that they need to accrue
- The request must contain headers Content-Type: application/json;charset=UTF-8 та X-Cbr-Authorization: Bearer API_TOKEN.
An example of a request:
curl 'https://your-domain.davintoo.com/api/v2/gift-store/report/add-bonuses' -H 'X-Cbr-Authorization: Bearer API_TOKEN' -H 'Content-Type: application/json;charset=UTF-8' --data-raw '{"userIds":[4048,5722],"points":20}'
Instead of the local address https://your-domain.davintoo.com you need to use the address of your instance.
Response
- In case of a successful request (HTTP response code - 200), a result of the form will be returned:
{ "data": true }
- In case of an error (HTTP response code - 400) returns a JSON object with information about the error.