Webhook herstellen

Webhooks sind eine einfache Möglichkeit, Informationen über den Empfang Ihrer Nachrichten und deren Antworten zu erhalten.. Wollen Sie einen Webhook erstellen, gehen Sie auf Unsere Plattform oder benutzen Sie einfach die API.

POST

/webhook

Body-Parameter

type
notwendig
Art des Webhooks (MO / DLR / STOP / CLICKER / BALANCE_ALERT)
url
notwendig
URL des Webhooks
signature You can create a secret signature so we can sign the webhook requests with that secret in the header X-SMSFactor-Signature

Beispiele


POST /webhook HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/json

{
  "webhook":{
    "type": "DLR",
    "url": "https://yourserverurl.com",
    "signature": "mysignature123"
    "status": "live",
    "last_http_code": null
  }
}
          
        

POST /webhook HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/xml
<?xml version="1.0" encoding="UTF-8" ?>
<webhook>
  <type>DLR</type>
  <url>https://yourserverurl.com</url>
  <signature>mysignature123</signature>
  <status>live</status>
  <last_http_code>null</last_http_code>
</webhook>
        
      

$response = \SMSFactor\Webhook::create([
  'webhook' => [
    'type' => 'DLR',
    'url' => "https://yourserverurl.com",
    "signature" => "mysignature123"
  ]
]);
$webhook_id = $response->webhook->webhook_id;
        
      

Ergebnisformat


{
  {
    "status": 1,
    "message": "OK",
    "webhook": {
        "webhook_id": "66",
        "type": "MO",
        "url": "https://yourserverurl.com"
        "signature": "mysignature123"
    }
  }
}
          
        

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <status>1</status>
    <message>OK</message>
    <webhook>
      <webhook_id>66</webhook_id>
      <type>DLR</type>
      <url>https://yourserverurl.com</url>
    </webhook>
</response>