Kontakte in der NZN Liste hinzufügen

Mit dieser Methode können Sie einen Kontakt zu Ihrer NPAI-Liste hinzufügen.

POST

/npai

Body-Parameter

value
notwendig
The recipient's number
info1 Information 1
info2 Information 2
info3 Information 3
info4 Information 4

Beispiele


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

{
  "npai": {
    "contacts": {
      "gsm": [
        {
          "value": "33612345678",
          "info1": "Hiroo",
          "info2": "Onoda"
        },
        {
          "value": "33612345677",
          "info1": "Grace",
          "info2": "Hopper"
        },
        {
          "value": "33612345676",
          "info1": "Hedy",
          "info2": "Lamarr",
          "info3": "Extase",
          "info4": "1933"
        }
      ]
    }
  }
}
          
        

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

<?xml version="1.0" encoding="UTF-8" ?>
<list>
  <contacts>
    <gsm info1="Hiroo" info2="Onoda">33612345678</gsm>
    <gsm info1="Grace" info2="Hopper">33612345677</gsm>
    <gsm info1="Hedy" info2="Lamarr" info3="Extase" info4="1933">33612345676</gsm>
  </contacts>
</list>
        
      

$response = \SMSFactor\ContactList::addToNpai([
    'npai' => [
      'contacts' => [
        'gsm' => [
          [
            'value' => '33612345678',
            'info1' => 'Hiroo',
            'info2' => 'Onoda'
          ],
          [
            'value' => '33612345677',
            'info1' => 'Grace',
            'info2' => 'Hopper'
          ],
          [
            'value' => '33612345676',
            'info1' => 'Hedy',
            'info2' => 'Lamarr',
            'info3' => 'Extase',
            'info4' => '1933'
          ]
        ]
      ]
    ]
]);
        
      

Ergebnisformat


{
  "status": 1,
  "message": "OK",
  "added_contacts": 3
}
          
        

<?xml version="1.0" encoding="UTF-8" ?>
<response>
  <status>1</status>
  <message>OK</message>
  <added_contacts>3</added_contacts>
</response>