Crea webhook

I webhooks sono un semplice strumento per ricevere informazioni sulla ricezione dei messaggi e sulle risposte. Per creare un webhook, devi loggarti con La nostra piattaforma and go to the Developer menu o con l'API.

POST

/webhook

Parametri del body

type
richiesto
L'url del webhook (MO / DLR / STOP / CLICKER / BALANCE_ALERT)
url
richiesto
Il tipo del webhook

Esempi


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

{
  "webhook":{
    "type": "DLR",
    "url": "https://yourserverurl.com"
  }
}
          
        

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

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

Formato della risposta


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

<?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>