Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://melotext.com/apis/addcontact/

Example Call: https://melotext.com/apis/addcontact/?apikey=APIKEY&group=GROUPNAME&number=PHONENUMBER&name=NAME&email=EMAIL&bday=BDAY

PHP Code Sample (cURL):

Code Block
languagephp
$url = 'https://melotext.com/apis/addcontact/';
$fields = array('apikey' => $api_key,
'group' => $group_name,
'number' => $number,
'name' => $name,
'email' => $email,
'bday' => $bday,
);
$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;

...

Return Code

Description

0

0 is passed back on successful API call.

-1

Invalid API key passed in.

-2

There was no number passed in.

-3

Group and number required.

-4

There was no group passed in.

-5

The group passed in is invalid or does not exist in the group list.

-6

Other error.

-7

Number is already subscribed for [group name].

-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)

Code Block
languagejson
{
    "status":"-7",
    "msg":"Number is already subscribed for home"
}