1. Copy the URL from the notification set up form.
2. Set up an event listener in your front-end or back-end code.
Either in your front-end or back-end code, listen for an event and then send a POST request to the URL. Here are the request body fields which you should send to the URL. The request body has to be in JSON format.
Parameter name | Parameter type | Description | Required |
customName | string | The person's name associated with the action. This will be displayed on the notification | true |
action | string | Description of the action. This field should say exactly what the person did. E.g. "Bought a car". If this field is missing we will use the notification action field you filled in when creating the notification. If you want to include a link in the notification, then replace that part of the text with {link} and send in the extra linkText and linkValue fields. Want to learn more about links? Have a look at this article. | |
image | string | Custom image associated with the action/person. If this field is not present, then the default campaign image will be used. | |
linkText | string | Text that should replace the {link} in the action field. | |
linkValue | string | The URL that the user should be redirected to when they click on the link. |
3. Try invoking the action and see if it works.
If the request is successful, the API will send back the following response:
If the request is not successful, the API will send back the following error message: