You are here:
Configure a REST Data Source Using Named Credentials on a Flexcard (Managed Package)
For the managed package runtime, use Named Credentials to authenticate Apex callouts when configuring a REST data source. A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
To create a named credential, see Named Credentials as Callout Endpoints.
For optimal flexibility and easier implementation, use an Integration Procedure as a data source to execute multiple actions in a single server call. See Configure an Integration Procedure Data Source on a Flexcard (Managed Package).
Before You Begin
-
Create a Named Credential. See Define a Named Credential.
- To configure the data source when creating a Flexcard, navigate to the Select Data Source Type step, select REST, and click Next.
- To configure the data source from the SetUp Panel in the Flexcard Designer, click Setup, and select REST from the Data Source Type dropdown.
- Select Named Credential from the REST type dropdown.
- From the Named Credential dropdown, select a Named Credential created from Setup > Named Credential in your org.
-
Enter a relative path in the Endpoint field to get what you need from the API, such as
My_Payroll_System/paystubs?format=json. -
Select a method type from the Method dropdown:
-
Select GET to requests data specified by the parameters of the URL.
-
Select POST to send JSON data.
-
Enter the JSON data to send in the JSON Payload field.
-
NoteYou can use Context Variables to pass inherited values with either method. See Flexcards Context Variables (Managed Package).
-
-
(Optional) To add any request headers, click + Add New next to Headers to add any request headers.
Note
Most third-party APIs expect various headers such as tokens, public keys, and content-type.
- (Optional) To configure other options common among all data sources, see Flexcards Data Source Properties (Managed Package).
- To test data source settings, add test variables that the query can use to return live data, see Test Data Source Settings on a Flexcard (Managed Package).
What’s next: Add elements to the Flexcard. See Add Elements to a Flexcard (Managed Package).
