REST Web Service Adaptor
  • 23 Aug 2024
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

REST Web Service Adaptor

  • Dark
    Light
  • PDF

Article summary

Creating REST Web Service Adaptor

We have included an Interactive Training to provide a more engaging and visual learning experience. End users are required to complete their training through the CSG University.


To create a new REST web service adaptor, it is necessary to have a REST web service connection defined. The connection defines the web service endpoint and the constant query parameters. Extensions to the resource string and additional query parameters are added to the adaptor screen. The Web Service Adaptor supports the GET, POST, PUT, DELETE, and PATCH web service methods. 

From the graphs tab on the Project Home screen, choose the Create button, or from the hamburger menu in the top left. Choose the REST web service adaptor, give it a name, and click on the. Click on the Create Button at the bottom of the screen. 

If you have already created a web service adaptor, then you can find that adaptor by clicking the open button

This will then open the Web Service Adaptor Screen. From here, you should select the connection and choose the method  GET, POST, PUT, DELETE, or PATCH


Request String (Including Query parameters)

The request string can now be edited to extend the complete URL by adding new resources or query parameters. 

To extend the URL, type the new resource or a parameter, and the Full Request URL above will update to show the complete web service call. 

  • To extend the URL to include the resource '/end/point' :
  • To extend the URL to include a resource that will be populated from a dynamic value:
  • To extend the URL to include a new query parameter with a constant value, include the question mark in the Request String:
  • To extend the URL to include a new query parameter that will be populated from a dynamic value:

Whenever the request string changes, including adding/removing parameters, the 'Save Edits' button should be used to update the parameters listing.


HTTP Request Headers

If you want to always apply certain constant (non-dynamic) request headers in all cases for a particular connection, those can also be set in the connection (see connector).

  • Click + Add HTTP Header to add an HTTP Request header key.

Update the value for a header in the text box. As with the request string, you can use parameters in these values to allow for run-time dynamic setting of headers (a common use case is setting authorization headers with tokens that expire over time and thus cannot be set as a constant value)

  • Use the Delete icon to delete an HTTP Request header.

Whenever changing the value of an HTTP Request header,  including adding/removing parameters, the 'Save Edits' button should be used to update the parameters listing.


Request Body Source

PUT, POST, and PATCH routes require a body to be set to be valid (though, if wanted, that body can be an empty object). The field is disabled for GET and DELETE.


AWS API Gateway Signature

AWS API Gateway Signature configuration will be enabled here if all the conditions are valid:

  • The REST Web Service Connection is selected from the Connection dropdown.
  • AWS API Gateway Signature is enabled and configured correctly in the REST Web Service Connection window.

String Conversion

If the content type is not explicitly set (in connector or adaptor) or if set as 'application/json', the request body source and the response will be converted to JSON if there are cases where we explicitly want to treat the source (PUT, POST, PATCH only) and/or the response body output (all methods, Body only -  response headers will always be JSON) as a raw text string, check the appropriate option.


Output

A location for the response body returned from a successful REST call is required for all methods. Response Headers and HTTP Status Codes can be optionally returned from the web service call. 

A location for the HTTP response headers returned from a successful REST call is optional for all methods. If the location is set, all response headers from a successful call will be accessible for use in the graph from the specified location. This is useful if the web service that you are calling returns values of interest in the headers, such as a rate limit remaining requests count or a set-cookie header. 

The data returned from the HTTP Status Code is an object with two nested fields. code is the HTTP Status Code, and reason is the corresponding reason phrase.


Validation Warnings

: All the invalid notifications will be displayed after expanding the Invalid Dropdown.

Warning

Note

Adaptor does not have connection set

Creating a connection and choosing it from the Adaptor Connection dropdown is necessary.

Adaptor(s) connection is not complete.

The adaptor has a connection set, but that connection has some information missing. Go to the connection details and ensure all required fields are completed. You could also see this message if your adaptor only has connection details filled out for one environment (non-active) but not others.

Parameter(s) need a data source

Some parameters have not been given data sources to read/write from. 

Adaptor's configuration requires a data source to be set

(PUT, POST, and PATCH only). For these methods, a body is required for the request, 'Request Body Source' must be set

Node(s) have missing data destination/output

All methods require a valid location for the REST Response Body


Related Pages:


Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence