Liste erstellen

Mit dieser Methode können Sie eine Kontaktliste erstellen. Jeder Kontakt kann bis zu 4 personalisierte Informationen enthalten. Diese Informationen können dann in jeder Nachricht integriert werden. Wenn Sie zum Beispiel [info1] in Ihren Text einfügen, wird dieser automatisch durch die entsprechenden personalisierten Kontaktinformationen ersetzt.

POST

/list

Body-Parameter

value
notwendig
Die Empfängernummer in format E.164
name Der Name der Liste. Wenn kein Name angegeben wird, wird das Erstellungsdatum als Standardname verwendet
info1 Information 1
info2 Information 2
info3 Information 3
info4 Information 4

Beispiele


POST /list HTTP/1.1
Host: api.smsup.ch
Authorization: Bearer your.token
Accept: application/json

{
  "list": {
    "name": "My list",
    "contacts": {
      "gsm": [
        {
          "value": "41781234567",
          "info1": "Louis",
          "info2": "de Broglie",
          "info3": "1892",
          "info4": "Dieppe"
        },
        {
          "value": "41781234566",
          "info1": "Richard",
          "info2": "Feynman",
          "info3": "1918",
          "info4": "New-York"
        }
      ]
    }
  }
}
          
        

POST /list HTTP/1.1
Host: api.smsup.ch
Authorization: Bearer your.token
Accept: application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<list>
  <name>My list</name>
  <contacts>
    <gsm>
      <value>41781234567</value>
      <info1>Louis</info1>
      <info2>de Broglie</info2>
      <info3>1892</info3>
      <info4>Dieppe</info4>
    </gsm>
    <gsm>
      <value>41781234566</value>
      <info1>Richard</info1>
      <info2>Feynman</info2>
      <info3>1918</info3>
      <info4>New-York</info4>
    </gsm>
  </contacts>
</list>
        
      

$response = \SMSFactor\ContactList::create([
    'list' => [
      'name' => 'My list',
      'contacts' => [
        'gsm' => [
          [
            'value' => '41781234567',
            'info1' => 'Louis',
            'info2' => 'de Broglie',
            'info3' => '1892',
            'info4' => 'Dieppe'
          ],
          [
            'value' => '41781234566',
            'info1' => 'Richard',
            'info2' => 'Feynman',
            'info3' => '1918',
            'info4' => 'New-York'
          ]
        ]
      ]
    ]
]);
      
    

Ergebnisformat


{
  "status": 1,
  "message": "OK",
  "contacts": 2,
  "id": "50433"     //the id of the created list
}
          
        

<response>
  <status>1</status>
  <message>OK</message>
  <contacts>2</contacts>
  <id>50433</id>
</response>