Getting Started

Installation

The Calendly Salesforce SDK is available as an unmanaged package which can be installed by using one of the links below:

Setup

To allow the Calendly Salesforce SDK to access your Calendly data you'll need to create a new personal access token by visiting https://calendly.com/integrations/api_webhooks. Once you've created your personal access token you'll then need to register a Named Credential in Salesforce to securely store your Calendly token.

Create Calendly Personal Access Token

Visit https://calendly.com/integrations/api_webhooks to create / copy your new personal access token (this will be used in the step below).

Create Salesforce Named Credential

Login to your Salesforce account and create a new Named Credential with the following attributes:

Label: Calendly Name: calendly_api URL: https://api.calendly.com Identity Type: Named Principal Authentication Protocol: Password Authentication Username: user Password: YOUR_CALENDLY_PERSONAL_ACCESS_TOKEN Generate Authorization Header: Disabled Allow Merge Fields in HTTP Header: Enabled

Test Connection

To ensure that the Calendly Salesforce SDK has access to your Calendly data you can test the connect by executing the Apex code below from your Salesforce developer console.

Before clicking the "Execute" button to run your code, ensure that the Open Log checkbox option is enabled so that you can confirm the request was successful.


try {
    CalendlyApi.UserResource userResource = CalendlyApi.getCurrentUser();
    
    System.debug('Current User:');
    System.debug(userResource);
} catch (CalendlyApi.CalendlyApiException e) {
    System.debug('Error');
    System.debug(e.title); 
    System.debug(e.message); 
}

An Execution Log should appear after running the code above; select the Debug Only option to filter the logs.

If the request was successful then you should see the user data of the Calendly user who created the personal access token in the Apex execution log.

Last updated

Was this helpful?