Create Custom notification
This endpoint generates a custom notification starting from the user. The recipients of the notification can be the user's friends/followers or the user himself (based on recipients_type value). Es. connections -> "user" added an item to the wishlist
info
This operation requires admin role.
HTTP Request
POST /api/v2/notification/notify/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
recipients_type | body | string | false | Can be 'connections' or 'user' (default is 'conections') |
type | body | string | true | An optional custom string to differentiate notifications |
embed | body | object | false | Embed |
title | body | string¦null | true | A title for the notification |
description | body | string¦null | true | A description for the notification |
user | body | integer | true | The user who issues the notification |
Example Body Parameters
- JSON
{
"recipients_type": "string",
"type": "string",
"embed": {Embed},
"title": "string",
"description": "string",
"user": "integer"
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"recipients_type": "string",
"type": "string",
"embed": {
"embed_type": "string",
"embed_id": "string",
"url": "string(uri)",
"metadata": "{}"
},
"title": "string",
"description": "string",
"user": "integer"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization: Bearer <token>'
};
fetch('/api/v2/notification/notify/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/notification/notify/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H "Authorization: Bearer <token>"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Response status code | None |