Configuring Rest API
About this task
To configure Rest API, complete the following steps:
Procedure
-
From the Journey control panel
within the Palette, drag-and-drop the Rest API control to
the required part on Canvas.
The Rest API Configuration dialog appears.
-
Provide values for the following fields:
- Name - Mandatory
- Description - Optional
- Rest URL - Provide an API on which you want to receive the data
- API Details - Select the API method and the
authentication mechanism. There are three API methods:
- GET – It is used to fetch the data from destination endpoint configured in rest URL
- POST - It is used to publish the data.
- PUT - It is used for publish/update the
records.
There are four Authentication mechanism - Basic, API Key, Oauth and None
Based on the selected API method and Authentication mechanism following fields appears:If you select Basic Authentication mechanism, then section Enter Credentials to authenticate appears with fields User name and Password.
If you select API Key Authentication mechanism, then section Enter Credentials to authenticate appears with fields Key Name and Key Value.
If you select Oauth Authentication mechanism, then section Enter Credentials to authenticate appears with fields Username, Password, Client ID, Client Secret and Token URL.
If you select None Authentication mechanism, no authorization details required.
-
Click Next.
The Request Payload page appears.
-
Select the Rest API type from JSON or
XML and add payload. Click on Sample
Payload for reference.
Note: Request Payload screen is available for POST and PUT API methods. For GET the fields remain disabled.
-
Click Next.
The Response Fields Mapping page appears.
-
Select JourneyFields from the dropdown and in the
Response Fields mention the response received from
the destination system.
Note: Response Mapping is mandatory for GET API Method but not for POST and PUT API methods.Responses are grouped in five classes:
- Informational responses (100–199)
- Successful responses (200–299)
- Redirects (300–399)
- Client errors (400–499)
- Server errors (500–599)
-
Click Save
Rest API will be configured and saved in Journey