The following topic demonstrates how to define multiple response codes for the CICS
catalog API methods. The steps in this topic are optional.
Before you begin
Ensure your API project is open in the IBM® z/OS® Connect
API editor. You can do this by
double-clicking the package.xml
file for your CICS catalog API project in the
Project Explorer view.Ensure that your CICS catalog service is assigned to
your GET method.
About this task
In this step, you will define response codes with unique response data mapping for each of
the GET and POST API methods.Note: The response mapping is effective only if the request completes
with a HTTP status code of 300 or lower.
Procedure
- In the API editor,
for the GET method, click
to open the response details for the GET API method.
- Click Add Response
The Add Response window
opens.
- Specify a response code of 404, and specify the following
rules:
- For Rule 1, specify
.../CA_RETURN_CODE
as the service field. Select
= for the comparison operator. Enter 20
for the comparison
value.
- Click OK. Save your changes, click
(Ctrl-S).
- In the API editor,
click for the GET method. Click the Add
Response button.
The Add Response window opens.
- Specify a response code of 500, and specify the following
rule:
- For Rule 1, specify
.../CA_RETURN_CODE
as the service field. Select
= for the comparison operator. Enter 21
for the comparison
value.
- Click OK.
- Ensure response code 200 is set as the default response code for the POST method if it is
not already set.
- Click the Response button for the 200 response
code.
- Click Set Response 200 As Default
- Save your changes to your API project by Clicking
(Ctrl-S).
Results
You have configured multiple response codes for your CICS catalog API GET and POST methods. You
may optionally define unique response mappings for you response codes. Your API is now ready to
deploy.