How to setup a Webhook for Receiving Messages and Notifications

To receive messages/events from SCG to your application, you can setup a delivery configuration (webhook) and Subscribe to the SCG-Message topic to have these events posted to their application as JSON/XML object.

Example of events in the SCG-Message that can be posted to the customer's application include:

  • DR (Message Delivery Receipts)
  • MO (Mobile Originated Messages)
  • Sender ID events
  • Contact status events

Delivery Configuration (webhook) setup :

  • Select Events Manager from the SDC portal and click on Delivery Configuration
  • Click on New Delivery Configuration

Delivery_config_Capture.PNG

  • Complete the configuration setup by adding your configuration name, callback url (Address) and click Create to complete the delivery configuration setup

Delivery_Config_2_Capture.PNG

 

Subscribe to SCG-Message Topic

  • Navigate to Events Manager and select Subscriptions
  • Click on New Subscription

Subscription_Capture.PNG

  • Complete the Subscription form by selecting "SCG-Message" from the Topic field
  • In the Event Type, the default is "all types" but you can select specific events in the Event Type field. 
  • Select your Delivery configuration from the drop down
  • Select a startdate and an end date if so desired. End dates/time are not mandatory
  • Select Create to complete the subscription setup

Subscription_2_Capture.PNG

  • Once completed, you should see a subscription with your delivery configuration like below:

Subscripion__3_Capture.PNG

Sample Event:

MT ( Mobile Termination) Event:

{
  "topic": "SCG-Message",
  "attempt": 1,
  "event": {
    "fld-val-list": {
      "attachment_ids": "UIRqnwwhbLS106HNECVzG5",
      "previous_state": "SENT",
      "message_request_id": "96Wf3kBe2DJXhyqBOxsFO6",
      "message_id": "176ySDuGoChplVgiz2lcm7",
      "to_address": "+14085551212",
      "has_attachment": true,
      "reason_description": "SUCCESS",
      "application_id": 1704,
      "reason_code": "200",
      "sender_id_alias": "Gladiator",
      "company-id": 15xx,
      "sender_id_id": "RexWQXiD7pF7KzvepiygC7",
      "external_message_request_id": "",
      "new_state": "DELIVERED",
      "fragments_count": 1,
      "from_address": "66000",
      "mt_price": 0.035
    },
    "evt-tp": "message_state_change",
    "timestamp": "2019-09-21T01:00:38.89Z"
  },
  "event-id": "p0UFoavETOWmOf3zBCRYLw"
}

(MO) Mobile Origination event

{  
  "topic":"SCG-Message",
  "attempt":1,
  "event":{  
      "fld-val-list":{  
        "sender_id_alias":"xxxxxxxxxxxxxxxxxxxxxxx",
        "mo_price":0.005,
        "company-id":xxx,
        "sender_id_id":"xxxxxxxxxxxxxxxxxxxxxxxxxx",
        "message_body":"Test MO message",
        "message_id":"6QX2csWrr064RzxhwHo0m7",
      "to_address":"66000",
        "has_attachment":false,
        "fragments_count":1,
        "from_address":"+14085551212",
        "application_id":304
      },
      "evt-tp":"mo_message_received",
      "timestamp":"2017-11-30T17:17:46.615Z"
  },
  "event-id":"jX5nAV9USriK2LkS6e0D0g"
Was this article helpful?
0 out of 0 found this helpful

0 Comments

Article is closed for comments.