
This blog describes steps on how to make HTTP Callout from Flow which uses Bearer Authentication to connect to Calendly API. It is intended for Salesforce Admins as well as Developers. The steps mentioned assumes basic knowledge on how to create simple flows in Salesforce which has been skipped to make the blog precise and focus on the integration.
The blog assumes that you have Calendly Personal Token which can be used to authenticate and authorize using the Authorizatoin = Bearer <Token> header
- Create External Credential with Authentication Protocol as Custom

- Add Prinicpal in the External Credential and then add Authentication Parameters with any Name (e.g. authval) and add the Authorization token as its Value

- Create Permission Set and enable access to Principal in the External Credential

- In the External Credential create Custom Header and add the Authorization value as merged field value.
Specify Name as “Authorization” and value as {!’Bearer ‘ & $Credential.CalendlyCustomEC.authval} so that the Authorization will reveal as Bearer XXXXXX

- Create Named Credential. In the Named Credential specify the following details:
Endpoint URL , Enable for Callouts, External Credential and Allow Formulas for HTTP Header and HTTP Body.

Let us now create a Screen Flow to Test
- Add Action node and select “Create HTTP Callout” beneath the list of all available actions in the right panel. Provide a name for External Service and select the Named Credential.

- In the next screen the URL Path will be selected automatically. Provide a label for the Invocable Action and select the POST action method.

- Copy the sample input JSON request body (in our example we are using the input request from https://developer.calendly.com/api-docs/4b8195084e287-create-single-use-scheduling-link ) and paste in the Sample JSON Request. Click Review to check the Data Structure. Click Next to confirm the data structure.

- In the “Select Sample Response Method” select either of the Options. We will use “Connect for Schema”.

- In the Next screen click “Connect”. If the API connection was successful then you will see the response data structure. Click Save.

- Once you are back in the Salesforce Flow you will see the API Callout external service created along with necessary Apex Classes.

- Provide a name to the Action.
- Create a variable resource in the “Set Request Body”. The Data Type and Apex Class will be auto selected as shown below.

- Click Done and save the flow.
You should now be able to extend the flow as per your requirements.

Get Your Free Assessment
Unlock the full potential of your CRM with MyOnlineAdmin. Whether you’re looking to refine your existing system or need comprehensive guidance on new CRM deployments, we’re here to ensure your organization’s CRM strategy thrives.