REST Web Service Adaptor
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 end point and the constant query parameters. Extensions to the resource string and additional query parameters are added in 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 . 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 just type the new resource or a parameter and the Full Request URL above will update to show the full 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 is changed, including adding/removing of parameters, the 'Save Edits' button should be used to update the parameters listing.
HTTP Request Headers
If wanting to always apply certain constant (non-dynamic) request headers in all cases for a particular connection, those can be also be set in the connection (see connector).
Use to add an HTTP Request header key.
Update the value for a header in the text box. As with the request string, 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 to delete an HTTP Request header.
Whenever changing the value of an HTTP Request header, including adding/removing of 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 a valid (though, if wanted, that body can be an empty object). The field is disabled for GET and DELETE.
String Conversion
If 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 explicitly wanting 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 Code 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
Warning | Note | |
---|---|---|
Adaptor does not have connection set | It is necessary to create a connection and choose it from the Adaptor Connection drop down | |
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
Privacy Policy
© 2022 CSG International, Inc.