URL brevi

Inserisci URL brevi nei messaggi.

POST

/send

POST

/send/lists

Parametri del body

text
richiesto
Il messaggio
value
richiesto
I numeri dei destinatari o l’id della lista
links
richiesto
L’URL da abbreviare
pushtype
richiesto
Il tipo di invio (alert o marketing)
delay Data d’invio Y-m-d H:i:s
sender Ti permette di personalizzare il mittente
gsmsmsid Un id di tua scelta per linkare il messaggio alla notifica di ricezione (solo per /send)

Esempi


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

{
  "sms": {
    "message": {
      "text": "Message via API with a first link : <-short-> and a second one : <-short->",
      "pushtype": "alert",
      "sender": "GLaDOS",
      "delay": "2019-09-05 10:26:21",
      "links": [
        "https://youtu.be/dQw4w9WgXcQ",
        "https://youtu.be/X61BVv6pLtw"
      ]
    },
    "recipients": {
      "gsm": [
        {
          "gsmsmsid": "100",
          "value": "33601020304"
        },
        {
          "gsmsmsid": "101",
          "value": "33601020305"
        }
      ]
    }
  }
}
          
        

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

<?xml version="1.0" encoding="UTF-8"?>
<sms>
  <message>
    <text>
      <![CDATA[Message via API with a first link : <-short-> and a second one : <-short->]]>
    </text>
    <pushtype>alert</pushtype>
    <sender>GLaDOS</sender>
    <delay>2019-09-05 10:26:21</delay>
    <links>https://youtu.be/dQw4w9WgXcQ</links>
    <links>https://youtu.be/X61BVv6pLtw</links>  
  </message>
  <recipients>
    <gsm gsmsmsid="100">33601020304</gsm>
    <gsm gsmsmsid="101">33601020305</gsm>
  </recipients>
</sms>
        
      

Formato della risposta


{
  "status": 1,      
  "message": "OK",
  "ticket": "14672468",   //The id of your campaign
  "cost": 2,              //The cost of your campaign
  "credits": 642,         //Your credits after your campaign has been created
  "total": 2,             //Number of message before filtering  
  "sent": 2,              //Number of message after filtering
  "blacklisted": 0,       //Number of blacklisted numbers
  "duplicated": 0,        //Number of duplicated numbers
  "invalid": 0,           //Number of invalid numbers
  "npai": 0               //Number of npai numbers
}
          
        

<response>
  <status>1</status>
  <message>OK</message>
  <ticket>14672468</ticket>
  <cost>2</cost>
  <credits>642</credits>
  <total>2</total>
  <sent>2</sent>
  <blacklisted>0</blacklisted>
  <duplicated>0</duplicated>
  <invalid>0</invalid>
  <npai>0</npai>
</response>