/
Get SMS Delivery Stats For a Contact

Get SMS Delivery Stats For a Contact

Description

This gets the delivery status for the most recent SMS sent to the contact. Accepts GET or POST requests.

URL

https://melotext.com/apis/getcontactsmsdeliveryreport/

Example Call: https://melotext.com/apis/getcontactsmsdeliveryreport/?apikey=APIKEY&number=NUMBER

PHP Code Sample (cURL):

$url = 'https://melotext.com/apis/getcontactsmsdeliveryreport/'; $fields = array('apikey' => $api_key, 'number' => $number, ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); $result = curl_exec($ch); return $result;

Parameters

Parameters

Required

Description

Parameters

Required

Description

apikey

Required

The API key of your account.

number

Required

Number for the contact you want to get the most recent delivery status for. It will only return most recent outbound message status for this number.

Include country code in the number
US Example: 12025248725 UK Example: 447481340516

Return Values

Return Code

Description

Return Code

Description

smsstatus

0 is passed back on successful API call when scheduling bulk SMS. The group SMS ID will be passed back on successful API call when sending bulk SMS immediately.

errormsg

The error message of the sms if it failed or was undelivered.

-1

Invalid API key passed in.

-2

Number passed in is blank.

-3

Number passed in is invalid or can't be found for outbound SMS sent to this number.

-20

Level 1 does not have access to the API. API can only be used with Levels 2, 3, and 4.

Example API Response (data is returned in universal and lightweight JSON format)

{ "smsstatus":"delivered", "errormsg":"" }