Information for: DEVELOPERS   PARTNERS

REST web service adaptor

The Acquia Journey connection defines the web service end point and the constant query parameters. The request string can be further modified within the adaptor configuration and any HTTP request payload can be specified.

Creating the adaptor

To create a REST web service adaptor, complete the following steps:

  1. Complete the steps for Adding an adaptor, and then for the Adaptor Action, select one of the following web service methods:
    • GET – The adaptor will use the HTTP GET method. A JSON response is expected.
    • POST – The adaptor will use the HTTP POST method.
    • PUT – The adaptor will use the HTTP PUT method.
    • PATCH – The adaptor will use the HTTP PATCH method.
    • DELETE – The adaptor will use the HTTP DELETE method.
  2. (Optional) Click Add HTTP Header, and then in the Name field enter an HTTP header name and click Add Header. Enter a value for your HTTP header field to the right of the header name.
  3. If your Adaptor Action is POST, PUT, or PATCH, set the Request Body Source by selecting the value you want to send from the Data pane and clicking its name, and then clicking the left arrow icon.
  4. To set the Response Body, in the Data pane, find the Schema key or Public Variable you want to save the reponse to and click its name, and then click the left arrow icon.
  5. (Optional) To set the Response Headers, complete the same instructions as in the previous step.

Dynamic parameters

The Request String field enables you to refine the Full Final Request URL by appending a URL path or a query string specific to an adaptor. You can integrate dynamic data into the Request String with parameters that you can associate with your Data schema or Public variables.

To add a request string to your adaptor, complete the following steps:

  1. Sign in to Acquia Journey.
  2. From the projects list, identify the project you want to create an adaptor for, and click its title. Acquia Journey will display the Overview tab for your project.
  3. Scroll to find the REST adaptor you want to modify and click its name.
  4. In the Request String field, enter a path or query string for the adaptor. As you type, Acquia Journey will update the Final Full Request URL.
  5. If you want to create one or more parameters, in the Request String field enter %% and the name of your parameter, and then %%. For example: %%ID%%. Click Save Edits to add the parameters to the Parameters section.
  6. (Optional) If you created any parameters, for each parameter, complete the following actions:
    1. In the Data pane, find the Schema key or Public Variable you want to save the reponse to, and click its name.
    2. In the Parameters section, find the parameter you want to associate the value from the previous step with, and then click its left arrow icon.

Acquia Journey saves any parameter assignments you make as you complete them.

Several ways the request string can be modified are in the examples that follow:

  • /end/point - Extends the URL to include the resource /end/point
  • /%%resource%% - Extends the URL to include a resource that will be populated from a dynamic value
  • ?newparam=456 - Extends the URL to include a new query parameter with a constant value include the question mark in the Request String
  • ?newparam=%%newParamVal%% - Extends the URL to include a new query parameter that will be populated from a dynamic value
  • /end/point/%%endPoint%%?qp2=hello&qp3=%%qp3Val%% - Extends the URL with a combination of the previously described options

Validation Warnings

Warning Description
Invalid Adaptor Adaptor connection is not complete Missing data destination/output The Output destination has not been set.