Using GET Method With REST Service Integration
- 14 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Using GET Method With REST Service Integration
- Updated on 14 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
The REST Service holds the configuration data which is shared between all calls to a service, including the base URL, authentication, and any custom headers. This service acts as a Folder, holding any number of REST Methods. Each REST Method defines an HTTP call that can be made to the URL defined in the REST Service.
Example
In this example, create a simple Rest Service Integration with GET method. This example utilizes the API that tracks various information regarding the International Space Station (Visit Where The ISS At? for more details on the API).
- Begin by navigating to a Designer Folder and selecting CREATE DATATYPES/INTEGRATION. NoteThough it is possible to create a REST integration via Add REST Service Integration within the Integrations Folder, it is advised instead to create an integration within a Designer Folder. This allows the user more mobility with the project, should they wish to export/import the integration to another instance, as well as for ease of access purposes.
- Next, navigate to External Services > Add REST Service, and click CREATE.
- In the resulting window, define the Service Name and paste https://api.wheretheiss.at/v1/ in the Service URL box and, if need be, adjust the authentication settings. NoteThis example does not require any additional authentication to work.
- Click OK to close and save.
- Next, from the Folder for the REST Integration, select Add Method to Service from the bottom toolbar.
- Begin by first naming the Service; then, type "satellites" into URL (Relative to Base); this will point the Service to a specific aspect of the API.
- Click the drop down arrow for HTTP Method, and select GET.
- Finish configuring the method by selecting JSON for Content Type.
- When these parameters have been configured, select OK to save and exit the Method configuration.
- Lastly, create a Flow to test the Rest Service Integration.
- In the Designer Folder select CREATE FLOW on the Folder Actions Panel.
- Then, name the Flow and select CREATE to proceed to the Flow Designer.
- In the Flow Designer, add the Service step from Integrations > My Integrations > REST Services category.
- Next, attach both the Done and Error paths to the End step.
Debugging
- Now select Debug on the top panel of the Flow Designer to test the Rest Service request.
- If properly configured, the Flow will follow the Done path.
- To view the results of the REST service, select the Rest Service step and choose View Input/Output Data.Output ResultsIf the Flow runs successfully, it will return the expected data return of the satellite's name and NORAD catalog id, along with a Status Code of 200, and the data of the Headers from the GET call.
Was this article helpful?