ajax-loader
rocket

API

Contact

Destination

Sender

SMS Model

SMS

SMS responses

User

Adding a contact to a contact list

This service allows you to add a contact to an Avosms contact list.

POST   https://api.avosms.com/v1/contact/add


Parameters

All the parameters below are to be sent in POST.

List of mandatory parameters
id Your AvoSMS account ID (email address)
key API key available from your "API Access" customer account
listContactId Contact list ID
contactTelephoneNumber Contact phone number


List of optional parameters
contactCivility Civility of the contact.
contactName Contact name.
contactFirstName First name of the contact.
contactEmail Contact email.
contactBirthday Anniversary of the contact.
contactOther Other contact information.

Example


<?php
$curl = curl_init("https://api.avosms.com/v1/contact/add"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIESESSION, true);
$postfields = array( 'id' => "{ID}", //REQUIRED 'key' => "{KEY}", //REQUIRED 'listContactId' => "{LIST CONTACT ID}", //REQUIRED 'contactTelephoneNumber' => "{CONTACT TELEPHONE NUMBER}", //REQUIRED
'contactCivility' => "{CONTACT CIVILITY}", //OPTIONNAL 'contactName' => "{CONTACT NAME}", //OPTIONNAL 'contactFirstName' => "{CONTACT FIRST NAME}", //OPTIONNAL 'contactEmail' => "{CONTACT EMAIL}", //OPTIONNAL 'contactBirthday' => "{CONTACT BIRTHDAY}", //OPTIONNAL 'contactOther' => "{CONTACT OTHER}", //OPTIONNAL );
$postfields_json = json_encode($postfields); $trame = http_build_query($postfields, '', '&'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $trame); $raw_response = curl_exec($curl); curl_close($curl);
$response = json_decode($raw_response);
$status_response = $response->status; $code = $response->code;
?>


Codes / Answers

When you make a request to our services, a response is returned to you in JSON format. You will find in the "code" field the return code following your request. In case of success, the return code contains " OK ".


If successful:
code (OK) Your request has been processed correctly.


In case of an error in the formatting / your input :
ERR_100 Unrecognized APIs.
ERR_101 The ID of the contact list is empty.
ERR_102 The contact number is empty.
ERR_103 No existing list of contacts for the ID entered.
ERR_104 The contact number already exists in the contact list.
ERR_105 The contact number formatting is not valid.
ERR_106 The country of origin of the number does not match the country in the contact list.
ERR_107 The type of the contact number is not allowed.


In the event of an error in processing by our services :
ERR_9XX Processing error, contact our services.
An internal processing error is reported to you by an error code "ERR_9XX", i.e. XX = non-fixed digits, depending on the type of error.


Have a question? Do you need help?