Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is the first second hands-on exercise to learn about the Syndeia RESTful Integration capability introduced in Syndeia 3.5.

...

The learning objectives of this exercise are as follows:

  1. Add multiple Requests to a

...

  1. RESTful repository in the Syndeia Web Dashboard

...

Add new requests to fetch data from the RESTful repository

...

View and browse responses to the requests

...

Organize requests into collections

  1. Create Collections

  2. Organize Requests in Collections

  3. Clone and Edit Requests

Preparation

This exercise assumes that the student has done the following preparations.

...

  1. Reviewed the content presented in Introduction to REST APIs and Syndeia RESTful Integration

  2. Able to access Syndeia Cloud 3.5 with a valid user account

  3. User account in Syndeia Cloud 3.5 has RESTFUL WRITE permission (contact Syndeia Cloud admin to verify)

Exercise

1/ Login to the Syndeia Cloud Web Dashboard and select the Repositories menu on the menu bar.

...

2/ Point to the RESTful repository type and select the + icon next to it to add a new RESTful repository, as shown in Figure 2 below.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

Creating a new RESTful repository in Syndeia implies that you are connecting to an existing enterprise tool or service via its RESTful API.

...

3/ In the Create repository form, specify the following values for the fields.

  • Repository type = RESTful (already selected)

  • URL = https://api.spacexdata.com/v3

  • Name = SpaceX Data

  • Description = SpaceX Data RESTful repository.

  • Authentication Type = None

...

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

It is helpful to give meaningful names and descriptions to your repositories so that you can easily identify them later. You can use set the name and description fields in the form above to other values.

4/ Click on the Create button.

5/ You should see the new SpaceX Data repository listed under the RESTful repository type. Select the SpaceX Data repository. It should show up in the Tree View on the RHS.

...

6/ Expand the SpaceX Data repository in the Tree View. It will take a few seconds to initialize and show a default collection named Default RESTful Request Collection when expanded.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

Collections are logical groupings of Requests. You can use them to organize Requests. Think of them as folders except that a Request can be a part of multiple Collections. A default Collection is made available when you add a new RESTful repository.

...

7/ Right-click on the Default RESTful Request Collection (or the SpaceX Data repository) in the Tree View and select Manage RESTful Collections and Requests.

...

8/ The Collections and Requests panel is the single panel to manage all the Collections and Requests for the given RESTful repository. You will use this panel to create, edit, clone, or delete Collections and Requests. This panel contains two tabs: Collections and Requests. The number on each tab shows the number of Collections and Requests that are defined for the given RESTful repository. In the initial state, there is 1 Collection (remember the Default RESTful Request Collection from previous steps) and 0 Requests.

...

9/ Click the Requests tab and then click on the + Add button. You will see an empty form to create a new Request, as shown in Figure 8 below.

...

10/ In the Create Request form, specify the following values for the fields.

  1. 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 RocketsMethod = GET(selected by default)

    URL = https://api.spacexdata.com/v3/rockets

  • The URL for the RESTful repository (https://api.spacexdata.com/v3) with a forward slash (/) is already filled out.

  • You will add rockets to that

    Payloads

  • URL = Replace rockets with payloads in the URL path, as shown

    in the figure

    below.

...

11/ Click on the Test button . Syndeia will send the request to the RESTful repository and if successful the response will to verify the new Request. If the Request is successful, the Response should be shown in a green box, as shown in the figure below. The response is in the JSON format, which is the most common data format for RESTful APIs.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

It is a good idea to test a Request before creating it. Testing a request verifies that the URL and other details in the Request are specified correctly.

...

12/ Click the Save button. You should see a green-colored message dialog stating Request created successfully. The

...

4/ Click on the Clone button. The newly created Get all Payloads Request should show in the table under the Requests tab of the Collections and Requests panel.

...

13/ Click on the X button on the top RHS of to close the Collections and Requests panel, as shown in the figure above.

14/ Expand the Default RESTful Request Collection. The new request Get all Rockets was added to the default collection since we did not specify a collection when creating the request. This request is a GET request and hence it is shown with a G icon.

...

15/ Expand the Get all Rockets request (G icon)5/ In the Tree View of the SpaceX Data RESTful repository, expand the Get all Payloads Request. Syndeia will send the request to the RESTful repository Request and if successful, the response Response will be shown under the request. In the figure shown below, the Request was successful and the resulting response includes data for 4 rockets. 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.

...

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

The response is shown with the following details.

  • The square bracket [ ] icon indicates that the response is an array

  • The text Response from [GET ‘rockets’] indicates that this is the response from the GET Request sent to the rockets endpoint. See the URL for the Request in Step 11 above.

  • The number (4) next to the response indicates the number of members in that response (4 rockets in this case).

...

16/ Expand Response from [GET ‘rockets’] (4). You will see data for each of the 4 rockets.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

Curly brace icon { } indicates that the data is a JSON object (key-value pairs). The number (23) indicates that the object includes 23 key-value pairs, or 23 fields with values.

...

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.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#F4F5F7

Responses are shown with the following icons that match standard JSON syntax

  • Square brackets [ ] indicate arrays of JSON objects

  • Curly braces { } indicate a single JSON object with key-value pairs

  • “ “ indicate primitive data, e.g. Strings, Integers, Booleans, Float/Double, etc.

...

18/ Now, let’s add another request to get all the SpaceX payloads. To do this, launch the Collections and Requests panel by right-clicking the SpaceX Data repository (or the default Collection or the Get all Rockets Request) in the Tree View (Hint: See Step 7) and click on the Requests tab.

...

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.