Call REST Endpoint task

You're 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.

Authentication

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:

  1. In the editable properties of the task, click +New authentication profile to open the Authentication profile dialog.
  2. 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:

  3. 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.
  4. Click Save.

Configure the Call REST Endpoint task

To configure the Call REST Endpoint task:

  1. Go to the Apigee UI and sign in.
  2. Select your organization using the drop-down menu in the upper left corner of the UI.
  3. Click Develop > Integrations.
  4. Search for or select the integration to edit from the Integrations list and click to open the integration designer.
  5. Select Add a task/trigger > Tasks to view the list of available tasks.
  6. Drag the Call REST Endpoint element to the integration designer.
  7. Click the Call REST Endpoint element on the designer to view the Call REST Endpoint task configuration pane.
  8. Configure the remaining fields using the configuration properties of the task.
  9. Changes to the properties are saved automatically.

Configuration properties

The following table describes the configuration properties of the Call REST Endpoint task.

Property Data type Description
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:

  • DELETE
  • GET
  • HEAD
  • PATCH
  • POST
  • PUT
URL query string parameters Query string key : String

Value: 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

Value: 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:

  • True : Calls the redirected URL if the Endpoint base URL is forwarded to another URL.
  • False: Does not call the redirected URL if the Endpoint base URL is forwarded to another URL.
Task should fail on HTTP error Boolean Exception handling strategy when the REST API call fails.

You can select any one of the values:

  • True : Throws an exception
  • False: Does not throw an exception. But returns the error code and the error message in the response.
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.