In the flow builder, you must add an action element for the HTTP Callout.
Before you do that, let’s set up the Named Credential the Callout needs.
In setup, go to Named Credentials, select the second tab for the External Credentials, and click on New.
Set up your External Credential as follows.
Per Bit.ly API documentation, your header must pass the Access Token to the Bit.ly API. Generate your Access Token on Bit.ly, as seen below.
Your Access Token will be saved in Principals under Named Credentials. Set it up as follows.
Paste the Access Token form Bit.ly into the value field.
Now your Principle is ready to be used.
The Bit.ly API expects the Access Token to be passed in the header. This is the header section that you will need to set up.
Create your first custom header as follows.
One more custom header is needed. Set it up exactly like in the image below.
Now you are ready to complete your Named Credential setup.
Having set up all parameters the HTTP Callout needs, go to your flow to create the action. Insert an action element and click on “Create HTTP Callout”.
Give it a Name and choose the Named Credential you created. Click Next.
Set up the following parameters.
Get your example request and response JSON here: https://dev.bitly.com/docs/tutorials/shorten-customize-links/
Paste the JSON and click on Review. Hit Done.
Do the same thing for the response. This will create the Apex Defined Variables.
You should see two checkmarks after you click on Done above. Once you complete these steps, your HTTP Callout will be ready.
Now let’s set up the remaining flows and the community (digital experience) site.