Exercise 29.2 - Organizing Requests in Collections
This is the second hands-on exercise to learn about the Syndeia RESTful Integration capability introduced in Syndeia 3.6.
In this exercise, we will use the open-source SpaceX Data REST API that provides endpoints to fetch data about SpaceX rockets, launches, ships, star links, and other missions.
Objectives
The learning objectives of this exercise are as follows:
Add multiple Requests to a RESTful repository in the Syndeia Web Dashboard
Create Collections
Organize Requests in Collections
Clone and Edit Requests
Preparation
This exercise assumes that the student has done the following preparations.
Reviewed the content presented in Introduction to REST APIs and Syndeia RESTful Integration
Able to access Syndeia Cloud 3.6 with a valid user account
User account in Syndeia Cloud 3.6 has RESTFUL WRITE permission (contact Syndeia Cloud admin to verify)
Successfully completed the first tutorial - Exercise 29.1 - Adding your first RESTful Repository and Request
Exercise
The first tutorial included step-by-step instructions to create a new RESTful repository and add a new Request. This tutorial includes step-by-step instructions to create multiple Requests and organize Requests in Collections.
1/ Right-click on the SpaceX Data repository or the default Collection and click on Manage RESTful Collections & Requests menu to open the Collections and Requests panel.
2/ The Request to get all payloads is similar to the one to get all rockets. So, we will clone the Get all Rockets Request and modify it. Click on the Clone icon shown under the Actions columns of the Get all Rockets row.
3/ In the Clone Request form, update the following fields as specified below.
Name = Get all Payloads
Description = Request to get all Payloads
URL = Replace rockets with payloads in the URL path, as shown below.
Click on the Test button to verify the new Request. If the Request is successful, the Response should be shown in a green box.
4/ Click on the Clone button. The newly created Get all Payloads Request should show in the table under the Requests tab.
Click on the X button on the top RHS to close the Collections and Requests panel.
5/ In the Tree View of the SpaceX Data RESTful repository, expand the Get all Payloads Request. Syndeia will send the Request and if successful, the Response will be shown under the Request.
As shown in the figure below, the Response includes data for 136 payloads. Expand the first payload, as shown in the figure below. You will see a payload with payload_id FalconSAT-2.
6/ In this step, you will create a new Collection. Launch the Collections and Requests panel, as you did in Step 1. You will see the Collections tab with 1 Collection listed in the table.
Click on the + Add button and specify the Name and Description for the new Collection, as shown in the figure below. Click on the Create button.
Collections are logical grouping of Requests. A Collection typically includes many Requests. A Request can be in multiple Collections. Collections can be created based on different criteria, such as:
Specific type of data or subsystem, e.g. all Requests related to Rockets are in a single collection
System development/lifecycle phase, e.g. all Requests related to Design versus Manufacturing vs Logistics
Frequency of Requests, e.g. Requests to run hourly, daily, weekly, or at project milestones
… and any other criteria
7/ Repeat the previous step to create another Collection with the following details.
Name = Payloads
Description = Requests related to Payloads
After successful creation, the Collections table will show the new Payloads and Rockets Collections.
8/ Now, you will add existing Requests to the two new Collections created in the steps above. Click on the Requests tab. Then, click on the Edit Request (Pencil) icon under the Actions column of the Get all Rockets Request row, as shown in the figure below.
9/ In the Update Request panel, click on the Select Collections drop down. Check the Rockets Collection and uncheck the Default RESTful Request Collection, as shown in the figure below. Click on the Update button.
Since a Request can be a part of multiple Collections, you can check multiple Collections in the Select Collections drop-down.
10/ Repeat the step above for the Get all Payloads Request and add it to the Payloads Collection. Click on X on the top RHS to close the Collections and Requests panel.
11/ In the Repository Tree View, collapse and expand the SpaceX Data repository. You should now see the two new Collections - Payloads and Rockets, as shown in the figure below. Expand the Collections and you should see:
Get all Payloads Request under the Payloads Collection
Get all Rockets Request under the Rockets Collection
12/ Challenge - Follow steps 1-4 to create a new Request to fetch data for a specific Rocket with id falconheavy
. The details for this Request are shown in the figure below.
13/ Collapse and Expand the Rockets Collection in the Tree View to verify if the Get Falcon Heavy Request is added. Expand the Get Falcon Heavy Request and verify if you get the same Response as shown in the figure below.
This is the end of the tutorial.
If you were able to complete all the steps in this tutorial successfully, Congratulations! You have successfully created multiple Requests and Collections, and learnt how to edit and clone Requests. You are ready for the next tutorial.
If you were not able to complete the steps in this tutorial successfully, feel free to contact us via our helpdesk. Our team will be happy to assist you.