> For the complete documentation index, see [llms.txt](https://calendly-salesforce-sdk.gitbook.io/calendly-salesforce-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calendly-salesforce-sdk.gitbook.io/calendly-salesforce-sdk/master.md).

# Getting Started

## Installation <a href="#getting-started-with-typescript" id="getting-started-with-typescript"></a>

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

* [Production Package Link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001qxnk)
* [Sandbox Package Link](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001qxnk)

## 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 ](https://help.salesforce.com/articleView?id=sf.named_credentials_about.htm\&type=5)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

![](/files/-MUxkTDQeI2IQ96tbXmb)

### 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](https://help.salesforce.com/articleView?id=sf.code_dev_console_opening.htm\&type=5).

![](/files/-MUy0FACUI5xqCvk-wNB)

{% hint style="info" %}
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.
{% endhint %}

```bash

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.

![](/files/-MUy5G_XC-RaJoqW-OC2)

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.
