Exercise 29.1 - Adding your first RESTful Repository and Request
This is the first hands-on exercise to learn about the Syndeia RESTful Integration capability introduced in Syndeia 3.5.
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 a new RESTful repository in the Syndeia Web Dashboard
Add a new Request to fetch data from the RESTful repository
View and browse the Response to the Request
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.5 with a valid user account
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.
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
It is helpful to give meaningful names and descriptions to your repositories so that you can easily identify them later. You can 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.
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.
Name = Get all Rockets
Description = Request to get all Rockets
Method =
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 URL path, as shown in the figure below.
11/ Click the Test button. Syndeia will send the request to the RESTful repository and if successful the response will 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.
12/ Click the Save button. You should see a green-colored message dialog stating Request created successfully. The 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 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). Syndeia will send the request to the RESTful repository and if successful, the 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.
16/ Expand Response from [GET ‘rockets’] (4). You will see data for each of the 4 rockets.
17/ Expand the data for the first rocket. You will see all the 23 key-value pairs. The name of this rocket is Falcon 1 (rocket_name) and the id of this rocket is falcon1 (rocket_id).
This is the end of the tutorial.
If you were able to complete all the steps in this tutorial successfully, Congratulations! You have successfully added your first RESTful repository to Syndeia and created your first Request. 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.