Test your newly created projectManager API by using the API
Explorer.
Before you begin
zosConnect-2.0 Applies to zosConnect-2.0.
The following tasks must be completed:
You must also ensure that you have the API Discovery feature enabled in the
server.xml
server configuration by adding the following element to the feature
list:
<feature>apiDiscovery-1.0</feature>
Note: Use of the API Discovery feature requires that you are using z/OS® Connect 3.0.48 and z/OS Connect API toolkit 3.0.9.4, 3.2.9.4, or later.
Procedure
-
Ensure your Db2 instance which has the native REST
services installed is running.
- Ensure your z/OS Connect Server is
running.
- View installed services.
Expand the z/OS Connect Server and the
Services subfolder and check the employeeList,
employeeDetails, and employeeUpdate services are
listed
- View installed APIs.
Expand the APIs subfolder and check the projectManager
API is listed
- In the z/OS Connect Servers view of the API toolkit, under the
APIs folder, double-click on the projectManager API.
The API opens in
the API Explorer. If you are not using the API Explorer feature, select Open in Swagger
UI from the context menu.
- Click List Operations to see available operations in the
API.
- Click GET /employees to test listing employees.
Click
Try it out!. Information about the request URL, request headers, response
body, response code, and response headers are provided.
The response body contains an array of employees.
- Click GET /employees/{employeeNumber} to get the details of a single employee.
Enter an
employeeNumber,
as found in the response from the previous request, in the
employeeNumber path parameter.
Click
Try it out!. Information about the request URL, request headers, response
body, response code, and response headers are provided.
The response body contains details for a single employee.
- Click PUT /employees/{employeeNumber} to update the details for a single employee.
Enter the same
employeeNumber,
firstName,
lastName,
hireDate, and
department
as used in the previous request, in the matching parameters. Enter a different 4 digit number in the
employeePhoneNumber request body.
Click
Try it out!. Information about the request URL, request headers, response
body, response code, and response headers are provided.
The response body contains details for a single employee.
- To confirm the update was successful, click GET /employees/{employeeNumber} to get the details of the same employee.
Enter the same
employeeNumber,
as used in the previous request, in the
employeeNumber path parameter.
Click
Try it out!. Information about the request URL, request headers, response
body, response code, and response headers are provided.
The response body contains details for a single employee.
Results
You have verified that your newly created projectManager API works to Db2.