Accueil » API SMS Octopush » Ajouter un contact

Ajouter un contact

POST
https://api.octopush.com/v1/public/contact/create

Encodage : UTF-8

Authentification

Vos identifiants « api-key » et « api-login » doivent être ajoutés dans les headers.

Définition

Ce web service vous permet d’ajouter un contact à une liste.

Paramètres particuliers

NomTypeDescription
list_namestringNom de la liste à laquelle le contact doit être ajouté.
contactsarrayListe d’objets de type contact :
[
  {
    "phone_number": "+111222233334444",
    "first_name": "Axelle",
    "last_name": "Durand",
    "param1": null,
    "param2": null,
    "param3": Mme,
    "param4": null,
    "param5": null
  },
  ...,
  {
    "phone_number": "+2222333334444555",
    "first_name": "John",
    "last_name": "Smith",
    "param3": "M"
  }
]

Exemple Curl

curl -X POST \ 
'https://api.octopush.com/v1/public/contact/create' \ 
-H 'Content-Type: application/json' \ 
-H 'api-login: ******@email.org' \ 
-H 'api-key: ************' \ 
-H 'cache-control: no-cache' \ 
-d '{
  "contacts": [
    {
      "phone_number": "+111222233334444",
      "first_name": "Axelle",
      "last_name": "Durand",
      "param3": "Mme"
    },
    {
      "phone_number": "+2222333334444555",
      "first_name": "John",
      "last_name": "Smith",
      "param3": "M"
    }
  ],
  "list_name": "my_list"
}'

Code à copier-coller

curl -X POST 'https://api.octopush.com/v1/public/contact/create' -H 'Content-Type: application/json' -H 'api-login: ******@email.org' -H 'api-key: ************' -H 'cache-control: no-cache' -d '{"contacts": [{"phone_number": "+111222233334444","first_name": "Axelle","last_name": "Durand","param3": "Mme"},{"phone_number": "+2222333334444555","first_name": "John","last_name": "Smith","param3": "M"}],"list_name": "my_list"}'

Retour Server en json

Succès : 201 CREATED