Kartra Documentation TECHNICAL DOCUMENTATION

Action: Subscribe lead to calendar

The API system will search in your account for the lead subscribed under that specific email, and it will subscribe the lead to the calendar.

 

Type Parameters Values
POST cmd* calendar_subscribe
POST calendar_name* string
POST class_name* string
POST starting_date string (DD Mmm YYYY) Timezone EST
POST starting_hour string (HH:MM) Timezone EST

* Required fields

Here is an example:

'lead' => [
    'email' => 'example@email.com'
],
'actions' => [
    '0' => [
        'cmd' => 'calendar_subscribe',
        'calendar_name' => 'First calendar',
        'class_name' => 'First class',
        'starting_date' => '16 Jan 2019',
        'starting_hour' => '15:00',
    ]
]

Success message:

{
  "status": "Success",
  "message": "The lead will be subscribed to calendar {calendar_name}, class {class_name}",
  "type": "112"
}

Error Cases:

Type Number Message Cause
255 calendar_name cannot be empty. Nothing done
  • The ‘calendar_name’ parameter is mandatory and needs to contain data
256 class_name cannot be empty. Nothing done
  • The ‘class_name’ parameter is mandatory and needs to contain data.
257 Invalid calendar. Nothing done
  • The calendar does not exist in the database or is not completed.
258 Invalid calendar class. Nothing done
  • The class does not exist in the database or does not belong to the calendar.
260 Invalid date format. Nothing done
  • starting_date does not have the correct ‘DD Mmm YYYY’ format or starting_hour does not have the correct ‘HH:MM’ format
261 Date is in the past. Nothing done
  • starting_date with starting_hour is in the past based on EST timezone.

An example of an error message:

{
  "status": "Error",
  "message": "Invalid calendar class. Nothing done",
  "type": "258"
}

© 2021 Kartra All Rights Reserved