How to add Recipient for your Reminder Group?

To add Recipient, you need to call below API with passing the Group Token. Group Token you will get it from Create or Update of Recipient Group screen.

POST Add Appointment

/index.php?r=api/addappointment

Body

raw (json)
{
 "token": "Your token",
 "name":"Recipient Name",
 "phone_number":"Recipient Number",
 "appointment_date": "appointment date(YYYY-mm-dd format)",
 "appointment_time": "appointment time (24Hour HH:MM format)",
 "phone_type":"Both or Call or SMS (Case-insensitive)",
 "custom_vars":{"branch": "Clearwater", "doctor":"Jane Smith"}
}

Sample curl Requests

1. With date and time in separate variables

curl -X POST \ '/index.php?r=api/addappointment' \ -H 'content-type: application/json' \ -H 'Origin: *.acmecorp.com' \ -d '{ "token": "0c86dsdasf33252gfdg18bb00d80105", "name":"API Appointment", "phone_number":"12345621414", "appointment_date": "2020-02-20", "appointment_time": "22:30", "phone_type":"Both", }'

2. With date and time together in one variable

curl -X POST \ '/index.php?r=api/addappointment' \ -H 'content-type: application/json' \ -H 'Origin: *.acmecorp.com' \ -d '{ "token": "0c86dsdasf33252gfdg18bb00d80105", "name":"API Appointment", "phone_number":"12345621414", "appointment_datetime": "2020-02-20 22:30", "phone_type":"Both" }'

3. With custom variables

curl -X POST \ '/index.php?r=api/addappointment' \ -H 'content-type: application/json' \ -H 'Origin: *.acmecorp.com' \ -d '{ "token": "0c86dsdasf33252gfdg18bb00d80105", "name":"API Appointment", "phone_number":"12345621414", "appointment_datetime": "2020-02-20 22:30", "phone_type":"Both", "custom_vars":{"branch": "Clearwater", "doctor":"Jane Smith"} }'

Sample curl Responses

{
    "status_code": 200,
    "message": "Appointment added successfully"
}
{ "status_code": 401, "message": "Token is missing" }
{ "status_code": 400, "message": "Token is invalid" }
{ "status_code": 400, "message": "Missing or invalid parameters" }
{ "status_code": 400, "message": "Phone Number is already exist in current Group." }
{ "status_code": 400, "message": "Phone Numbers must be 11-digits and starts with 1" }
{ "status_code": 400, "message": "Invalid Phone Type passed" }
{ "status_code": 400, "message": "Appointment schedule is in the past" }
{ "status_code": 404, "message": "Custom variable is missing" }
{ "status_code": 404, "message": "A value for a non-existent custom variable is added" }
{ "status_code": 404, "message": "A value for a custom variable is missing" }
{ "status_code": 404, "message": "Custom variables are duplicated" }

How to remove Recipient for your Reminder Group?

To remove Recipient. you need to call below API with passing the Group Token. Group Token you will get it from Create or Update of Recipient Group screen.

DELETE Remove Appointment

/index.php?r=api/removeappointment

Body

raw (json)
{
    "token": "Your token",
    "phone_number":"Recipient Number",
    "appointment_date": "appointment date(YYYY-mm-dd format)",
    "appointment_time": "appointment time (24Hour HH:MM format)"
}

Sample curl Requests

1. With date and time in separate variables

curl -X DELETE \ '/index.php?r=api/removeappointment' \ -H 'content-type: application/json' \ -H 'Origin: *.acmecorp.com' \ -d '{ "token": "0c86dsdasf33252gfdg18bb00d80105", "phone_number":"12345621444", "appointment_date": "2020-02-20", "appointment_time": "22:30" }'

2. With date and time together in one variable

curl -X DELETE \ '/index.php?r=api/removeappointment' \ -H 'content-type: application/json' \ -H 'Origin: *.acmecorp.com' \ -d '{ "token": "0c86dsdasf33252gfdg18bb00d80105", "phone_number":"12345621444", "appointment_datetime": "2020-02-20 22:30" }'

Sample curl Responses

{
    "status_code": 200,
    "message": "Appointment removed successfully"
}
{ "status_code": 401, "message": "Token is missing" }
{ "status_code": 400, "message": "Token is invalid" }
{ "status_code": 400, "message": "Missing or invalid parameters" }
{ "status_code": 400, "message": "Appointment not found" }