Add Appointments
Description
Add contact appointments. Accepts GET or POST requests.
URL
https://melotext.com/apis/addappointment/
Example Call: https://melotext.com/apis/addappointment/?apikey=APIKEY&number=PHONENUMBER&apptdate=APPTDATE&status=STATUS
PHP Code Sample (cURL):
$url = 'https://melotext.com/apis/addappointment/';
$fields = array('apikey' => $api_key,
'number' => $number,
'apptdate' => $apptdate,
'status' => $status,
);
$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 |
---|---|---|
apikey | Required | The API key of your account. |
number | Required | The number of the contact. NO spaces, dashes, or parentheses in phone numbers. Include country code in the number US Example: 12025248725 UK Example: 447481340516 |
apptdate | Required | The appointment date/time. Format: DD-MM-YYYY HH:MM |
status | Required | The status of the appointment. Valid values are 0, 1, 2, 3. 0=>Unconfirmed, 1=>Confirmed, 2=>Cancelled, 3=>Rescheduled |
appointment_reminder | Optional | Enable appointment reminder of the appointment. Valid values are 0, 1. 0 =>No, 1=>Yes |
appointment_reminder_date | Optional | If appointment reminder enabled then date/time for reminder is required. Format: DD-MM-YYYY HH:MM |
Return Values
Return Code | Description |
---|---|
0 | 0 is passed back on successful API call. |
-1 | Invalid API key passed in. |
-2 | There was no contact number passed in. |
-3 | Number passed in should only contain numbers, NO spaces, dashes, or parentheses in phone numbers. |
-4 | There was no appt date/time passed in. |
-5 | There was no status passed in. |
-6 | The status passed in is invalid. Valid values are 0, 1, 2, 3. |
-7 | Contact not found. |
-8 | Appointment already exists for this contact and datetime. |
-9 | Other error. |
-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)
{
"status":"-2",
"msg":"There was no contact number passed in."
}