Home » Introduction of Octopush SMS Gateway 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
list_namestringName of the list to which the contact should be added.
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"
  }
]
auto_remove_blacklisted_numbersboolean(optional) By transmitting this field with “true” value, the blacklisted numbers will be automatically removed from your list of numbers.

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

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

JSON Server Response

Success : 201 CREATED