Skip to content
Home » Octopush Gateway SMS API » Add a contact

Add a contact

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

Encoding : UTF-8

Authentication

Your “api-key” and “api-login” must be added in the headers.

Definition

This web service allows you to add a contact to a list.

Special parameters

NameTypeDescription
contactsarrayList of contact objects:
[
  {
    "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] Name of the list to which the contact should be added.
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) If this field is given with a value “true”, then if you try to add a contact whose number already exist, instead of overwriting it with your new data, we will ignore it.

Curl Example

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"
}'

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"}'

JSON Server Response

Success : 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"
        }
    ]
}