viewing Apigee X documentation.
View Apigee Edge documentation.
The Call REST Endpoint task lets you call any third-party REST API from your integration. The response from the REST API call will be available to you in an integration variable and can be used in other down-stream tasks.
To use this task, you may need to create an authentication profile. Apigee Integration uses the authentication profile to connect to an authentication endpoint for the REST API call. If your API does not require authentication, the authentication profile field in the task configuration pane can be left empty.
To create an authentication profile, perform the following steps:
- In the editable properties of the task, click +New authentication profile to open the Authentication profile dialog.
- Set the following properties:
- Authentication profile name: Enter the name of the authentication profile to be displayed in the integration designer.
- Authentication profile description (optional): Enter a description of the authentication profile.
- Authentication profile visibility: Select the radio button corresponding to the desired level of visibility.
- Visible to all users in the client: The authentication profile created is available to all users in the organization.
- Only visible to you: The authentication profile created is not visible to any other users in the organization.
- Authentication type: Select the authentication type from the list of available options.
The Call REST Endpoint supports the following authentication types:
- Configure the remaining fields required by the authentication type selected. You can find detailed descriptions of the configuration fields for each authentication type in Create authentication profiles in Apigee Integration.
- Click Save.
Configure the Call REST Endpoint task
To configure the Call REST Endpoint task:
- Go to the Apigee UI and sign in.
- Select your organization using the drop-down menu in the upper left corner of the UI.
- Click Develop > Integrations.
- Search for or select the integration to edit from the Integrations list and click to open the integration designer.
- Select Add a task/trigger > Tasks to view the list of available tasks.
- Drag the Call REST Endpoint element to the integration designer.
- Click the Call REST Endpoint element on the designer to view the Call REST Endpoint task configuration pane.
- Configure the remaining fields using the configuration properties of the task.
- Changes to the properties are saved automatically.
The following table describes the configuration properties of the Call REST Endpoint task.
|Endpoint base URL||String||REST endpoint URL without the query parameters.|
|HTTP method||NA||HTTP method to use.
You can select any of the following HTTP methods:
|URL query string parameters||Query string key : String
|Query parameters required for the REST API call.
The query parameters are in the form of key-value pairs where key is the key name and the value is the corresponding key value. You can enter more than one key-value pair by clicking on the plus icon.
|HTTP headers||HTTP header key: String
|HTTP headers required for the REST API call.
The HTTP headers are in the form of key-value pairs where key is the key name and the value is the corresponding key value. You can enter more than one key-value pair by clicking on the plus icon.
|Follow redirects||Boolean||Follow URL redirects.
You can select any one of the values:
|Task should fail on HTTP error||Boolean||Exception handling strategy when the REST API call fails.
You can select any one of the values:
|responseHeader (<Task name>)||String||Uncompressed response header from the REST APIs response.|
|responseBody (<Task name>)||String||Uncompressed response body from the REST APIs response.|
|responseStatus (<Task name>)||String||HTTP response code and the corresponding code text from the REST APIs response.|
Retry on failure
You can configure various retry strategies to handle errors in a task. The retry strategies allow you to specify how to rerun the task in case of an error. For more information, see Error handling strategies.