Webhooks Mechanism

The Webhooks mechanism allows you to receive POST requests to a specified URL when events occur related to:

  • Single messages

  • Template-based messages

  • Single SMTP messages

Webhook Payload Structure

{
  "message": {
    "id": 1
  },
  "event": {
    "name": "clicked",
    "timestamp": 1539062173,
    "data": {
      "url": "https://example.com"
    }
  }
}

 

Key Fields:

  • message.id: Identifier of the message associated with the event.

  • event: Contains event details:

    • name: Type of event (see below).

    • timestamp: Unix timestamp of the event.

    • data: Additional context (e.g., URL for clicked events).


 
Events type 

 

Event Description
delivered Message successfully delivered.
opened Message was opened by the recipient.
clicked Recipient clicked a link (event.data.url contains the URL).
unsubscribed Recipient unsubscribed.
complained Recipient marked the message as spam.
skipped Message not sent (e.g., recipient previously unsubscribed/complained).
soft_bounced Message temporarily rejected by recipient’s server (may retry).
hard_bounced Message permanently rejected by recipient’s server.

 

Enabling Webhooks

JSON Request Example:

 

{
  "url":"https://example.com/some/path"
}



HTTP Request Example:

curl -X POST https://api.msndr.net/v1/email/webhook \
     -H 'Content-Type: application/json'       \
     -H 'Authorization: Bearer $API_TOKEN'     \
     -d '...JSON...'


 
 
 
Uses POST and /email/webhook endpoint
 

curl -X POST https://api.msndr.net/v1/email/webhook \
     -H 'Content-Type: application/json'       \
     -H 'Authorization: Bearer $API_TOKEN'     \
     -d '...JSON...'

Successful Response:

{
  "url":"https://example.com/some/path"
}


 

Parameter   

Description

      Required

url

Your endpoint for event data

        yes

 

Retrieving Webhook Settings
 
HTTP request example:

curl -X GET https://api.msndr.net/v1/email/webhook  \
     -H 'Content-Type: application/json'       \
     -H 'Authorization: Bearer $API_TOKEN'


 
Uses GET and /email/webhook endpoint
 
Successful response:

{
  "url":"https://example.com/some/path"
}


 
Returns the currently configured webhook URL.
 

Disabling Webhooks


 
json Request Example:

{
  "url":"https://example.com/some/path"
}


 

HTTP Request Example:

 

 

curl -X DELETE https://api.msndr.net/v1/email/webhook \
     -H 'Content-Type: application/json'         \
     -H 'Authorization: Bearer $API_TOKEN'


 
Uses DELETE method and /email/webhook endpoint
 

Already using Cloud4U services?

Visit our website

Try for free

  • 54 Users Found This Useful
Was this answer helpful?

Related Articles

Отправка сообщений по SMTP

Базовый URL smtp.msndr.net Порт 25 или 587 Использование шифрования SSL\TLS не является...

Email Service API - General Information

Through the Email Newsletter Service's Application Programming Interface (API), you can send...

Restrictions on the Service to prevent spam

In order to prevent spam, there is a mechanism that limits the number of messages you can send....

Sending one email message

Sending an email message Example of json data for a request:   {...

Getting information about templates

You can retrieve the list of templates using the following HTTP request: curl -X GET...