POST
https://api.octopush.com/v1/public/contact/createEncoding : 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
| Name | Type | Description |
|---|---|---|
| contacts | array | List 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_name | string | (optional) [max-length : 30 chars] Name of the list to which the contact should be added. |
tag_name | string | (optional) [max-length : 20 chars] Name of the tag that will be attached to each contact. |
auto_remove_blacklisted_numbers | boolean | (optional) By transmitting this field with “true” value, the blacklisted numbers will be automatically removed from your list of numbers. |
do_not_overwrite | boolean | (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"
}
]
}