Skip to content
Inicio » API SMS Octopush » Añadir un contacto

Añadir un contacto

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

Codificación : UTF-8

Autentificación

Los identificadores “api-key” y “api-login” deben añadirse en las cabeceras.

Definición

Este servicio web permite añadir un contacto a una lista.

Parámetros especiales

NombreTipoDescripción
contactsarrayLista de objetos de tipo de contacto :
[
  {
    "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"
  }
]
list_namestring(optional) [max-length : 30 chars] Nombre de la lista a la que debe añadirse el contacto.
tag_namestring(optional) [max-length : 20 chars] Name of the tag that will be attached to each contact.
auto_remove_blacklisted_numbersboolean(optional) By transmitting this field with “true” value, the blacklisted numbers will be automatically removed from your list of numbers.
do_not_overwriteboolean(optional) Si este campo tiene el valor “verdadero”, entonces, si intenta agregar un contacto cuyo número ya existe, en lugar de sobrescribirlo con sus nuevos datos, lo ignoraremos.

Ejemplo Curl

curl -X POST \ 
'https://api.octopush.com/v1/public/contact/create' \ 
-H 'Content-Type: application/json' \ 
-H 'api-key: ************' \ 
-H 'api-login: ******@email.org' \ 
-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",
  "tag_name": "vip"
}'

Command to copy/paste

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", "tag_name":"vip"}'

Respuesta Servidor JSON

Éxito : 201 CREATED

Example of return

{
    "items": [
        {
            "phone_number": "+3735555555560",
            "email": "[email protected]",
            "status": "added"
        },
        {
            "phone_number": "+3735555555561",
            "email": "[email protected]",
            "status": "updated"
        },
        {
            "phone_number": "+3735555555562",
            "email": "[email protected]",
            "status": "skipped"
        }
    ]
}

a