Build an Integration that Exposes the REST API Using the REST Adapter

The REST Adapter can be used in scenarios such as integrating with Twitter. Twitter provides several REST endpoints for accessing resources. This use case describes how to access a protected resource from Twitter using the Basic Authentication security policy.

Obtain the Twitter Credentials

  1. Obtain the necessary Twitter connection details from the Twitter developer page at https://dev.twitter.com. These keys are required for configuring the Twitter Adapter on the Connections page. See Using the Twitter Adapter with Oracle Integration 3 for specific details.

    • Consumer key

    • Consumer secret

    • Access token

    • Access token secret

Configure the Twitter Adapter

  1. In the Credentials dialog on the Connections page of Oracle Integration, complete the following fields with the information obtained from Twitter. Note that the Custom Security Policy security policy is displayed by default, and cannot be deselected.

    • In the Consumer Key field, enter the consumer key.

    • In the Consumer Secret field, enter the consumer secret.

    • In the Access Token field, enter the access token.

    • In the Access Secret field, enter the access token secret.

Configure the REST Adapter

  1. In the Connections page of Oracle Integration, complete the following fields.

    • In the Connection Properties dialog, select REST API Base URL and specify the connection URL.

    • In the Credentials dialog, select Basic Authentication as the security policy and specify the applicable user name and password.

Create an Integration

  1. Drag a REST Adapter to the trigger side, and configure it as follows:

    • Specify the following parameters on the Basic Info page:

      • Select the POST action.

      • Select Configure a request payload for this endpoint.

      • Select Configure this endpoint to receive the response.

    • Specify the request schema on the Request page.

    • Specify the response schema on the Response page.

  2. Drag a Twitter Adapter to the invoke side, and configure it as follows:

    • Select the Tweet operation.

  3. In the request mapper, configure the appropriate source to target mapping.

  4. In the response mapper, configure the appropriate source to target mapping.

Invoke the Integration

  1. Invoke the integration from a browser:

    https://host:port/integration/flowapi/rest/TWEET/v01/tweet?status=Hi Twitter from ICS

    This posts the request status to Twitter.

  2. Log in to the Twitter account.

  3. Note the request message and the response message.

    Description of ics_twitter_response.png follows
    Description of the illustration ics_twitter_response.png