1. Home
  2. Gateway
  3. HTTP Api
  4. Webhooks

Webhooks

This endpoint allows you to create, view and delete webhooks.

Please send the request to the following URL:

https://gateway.sms77.io/api/hooks

No other parameters are required for the query apart from your authentication data. The return is in JSON format.

Required parameters

Parameters Description Examples
action The action to be performed read – Lists all active webhooks
subscribe – Create a Webhook
unsubscribe – Delete a Webhook

Register Webhook

Parameters Description Examples
target_url Target URL of your Webhook https://your-domain.com/webhook
event_type Type of event for which you would like to receive a webhook all – sends all events
sms_mo – New inbound SMS
dlr – Status reports of your SMS
voice_status – Updates of the voice call status.
request_method Request method in which you want to receive the webhook POST – You receive Webhooks as HTTP POST Request as application/x-www-form-urlencoded (default)
GET – You receive Webhooks as HTTP GET request
JSON – You receive Webhooks as JSON Payload via a HTTP POST request
Example

https://gateway.sms77.io/api/hooks?p=IHR_API_KEY&action=subscribe&target_url=https%3A%2F%2Fyour-domain.com%2Fwebhook&event_type=sms_mo&request_method=GET

In case of success you will receive the following return:

{
  "success": true,
  "code": null,
  "id": 12345
}

Delete Webhook

Call the API with action=unsubscribe and the same parameters used to create the webhook (target_url, event_type, request_method) to delete it. You will get the same return as when you created the webhook.

Alternatively, you can delete a Webhook directly using the respective ID and without target_url, event_type, request_method löschen . To do this, specify the parameter id.

You get the same return as when you created the webhook.

Example

https://gateway.sms77.io/api/hooks?p=IHR_API_KEY&action=unsubscribe&id=123

Or:

https://gateway.sms77.io/api/hooks?p=IHR_API_KEY&action=unsubscribe&target_url=https%3A%2F%2Fyour-domain.com%2Fwebhook&event_type=sms_mo&request_method=GET

Read Webhooks

Use the parameter action=read to read out all current webhooks of your account.

Example

https://gateway.sms77.io/api/hooks?p=YOUR_API_KEY&action=read

{
  "success": true,
  "code": null,
  "hooks": [
    {
      "id": "23",
      "target_url": "https:\/\/your-domain.com\/webhook",
      "event_type": "sms_mo",
      "request_method": "POST",
      "created": "2020-11-04 13:49:16"
    }
  ]
}
Was this article helpful to you? Yes No
Menu