Skip to main content

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 authentication and admin role.

HTTP Request

POST /api/v2/notification/notify/

Parameters

NameInTypeRequiredDescription
recipients_typebodystringfalseCan be 'connections' or 'user' (default is 'conections')
typebodystringtrueAn optional custom string to differentiate notifications
embedbodyobjectfalseEmbed
titlebodystring¦nulltrueA title for the notification
descriptionbodystring¦nulltrueA description for the notification
userbodyintegertrueThe user who issues the notification

Example Body Parameters

{
"recipients_type": "string",
"type": "string",
"embed": {Embed},
"title": "string",
"description": "string",
"user": "integer"
}

Example Request

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);
});

Responses

StatusMeaningDescriptionSchema
204No ContentResponse status codeNone