Error Handling

All CalendlyApi methods will throw a CalendlyApiException error if Calendly responds with a status code >=400.

try {
    CalendlyApi.Organization organization = CalendlyApi.getCurrentOrganization();
    organization.sendOrganizationInvitation('invalid_email');
} catch (CalendlyApi.CalendlyApiException e) {
    System.debug('Error');
    System.debug(e.title); // "Invalid Email"
    System.debug(e.message); // "invalid_email is an invalid email format"
}

Last updated

Was this helpful?