PushNotification - OgnianApostolov/builderly-api-docs GitHub Wiki

Model

PushNotification notification{
    "_id": {
        "autogenerated": "true"
    },
    "title": {
        "type": "string",
        "required": "true"
    },
    "body": {
        "type": "string"
    },
    "image": {
        "type": "string"
    },
    "send_to": {
        "type": "string"
    },
    "createdAt": {
        "autogenerated": "true"
    },
    "updatedAt": {
        "autogenerated": "true"
    }
}

Methods

Create new

POST /push-notification req.body required

method: 'POST'
{
    url: 'https://{{your-builderly-domain}}/push-notification',
    headers: {
        'Authorization': 'Bearer ' + token
    },
    json: true,
    body: { notification }
}

Responses Success - status 201

{}

Error - status 400

{
    error_message
}

Retrieve multiple

GET /push-notification-info

method: 'GET'
{
    url: 'https://{{your-builderly-domain}}/push-notification-info',
    headers: {
        'Authorization': 'Bearer ' + token
    },
    json: true,
    body: {}
}

Responses Success - status 200

[{
    potential,
    registered,
    nonRegistered
}]

Error - status 500

{
    error_message
}
  • Example usages: /push-notification-info - Get all notifications

Delete single

DELETE /push-notification/:id?

method: 'DELETE'
{
    url: 'https://{{your-builderly-domain}}/push-notification/{{notification._id}}',
    headers: {},
    json: true,
    body: {}
}

Responses Success - status 200

{ notification }

Not found - status 404

{}

Error - status 500

{
    error_message
}