ajax-loader
rocket

API

Contact

Destination

Sender

SMS Model

SMS

SMS responses

User

Retrieve a list of contacts

This service allows you to retrieve information from a list of Avosms contacts.

POST   https://api.avosms.com/v1/contact/list/information


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 ID of the list of contacts to retrieve

Example


<?php
$curl = curl_init("https://api.avosms.com/v1/contact/list/information"); 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 );
$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;
if($code == "OK") { $listContactName = $response->list_contact_name; $listContactCountryName = $response->list_contact_country_name; $listContactCountryCode = $response->list_contact_country_code; $nbContactList = $response->nb_contact_list; $listContactCreationDate = $response->list_contact_creation_date;
$contactList = $response->list_contact;
foreach($contactList as $contact_list) { $contactCivility = $contact_list->contact_civility; $contactName = $contact_list->contact_name; $contactFirstName = $contact_list->contact_first_name; $contactTelephoneNumber = $contact_list->contact_telephone_number; $contactEmail = $contact_list->contact_email; $contactBirthday = $contact_list->contact_birthday; $contactOther = $contact_list->contact_other; } }
?>


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.
list_contact_name Name of the contact list.
list_contact_country_name Name of the country in the contact list.
list_contact_country_code ISO2 code of the country of the contact list.
nb_contact_list Number of contacts in the contact list.
list_contact_creation_date Date of creation of the contact list (format: YYYY-MM-DD HH:MM:SS).
list_contact Table containing the contacts in the list.

Variables of the table containing the contacts in the list (list_contact)
contact_civility Civility of the contact.
contact_name Contact name.
contact_first_name First name of the contact.
contact_telephone_number Contact phone number.
contact_email Contact email.
contact_birthday Anniversary of the contact.
contact_other Other contact information.


In case of an error in the formatting / your input :
ERR_100 Unrecognized APIs.
ERR_101 No existing list of contacts for the ID entered.


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?