Patch a Specific Prize
This endpoint patches a specific prize
info
You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).
For example to change active
flag in an admin list/table interface.
info
This operation requires admin or editor role.
HTTP Request
PATCH /api/v2/loyalty/prize/{id}/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | A unique integer value identifying this loyalty prize |
body | body | LoyaltyPrize | false | The request body(loyalty prize params) |
Example Body Parameters
- JSON
{
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/loyalty/prize/{id}/',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PATCH /api/v2/loyalty/prize/{id}/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--DATA '{body}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Loyalty Prize |
Example responses
- 200
{
"id": "integer",
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
"created_at": "string",
"lastmod_datetime": "string",
"created_by": {User}
}