Define catalog API response codes

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

  1. In the API editor, for the GET method, click Mapping... > Define Reponse Codes to open the response details for the GET API method.
  2. Click Add Response
    The Add Response window opens.
  3. Specify a response code of 404, and specify the following rules:
    1. For Rule 1, specify .../CA_RETURN_CODE as the service field. Select = for the comparison operator. Enter 20 for the comparison value.
    2. Click OK. Save your changes, click File > Save (Ctrl-S).
    Adding a 404 response.
  4. In the API editor, click Mapping... > Define Response Codes for the GET method. Click the Add Response button.
    The Add Response window opens.
  5. Specify a response code of 500, and specify the following rule:
    1. For Rule 1, specify .../CA_RETURN_CODE as the service field. Select = for the comparison operator. Enter 21 for the comparison value.
    2. Click OK.
    Adding a 500 response.
  6. Ensure response code 200 is set as the default response code for the POST method if it is not already set.
    1. Click the Response button for the 200 response code.
    2. Click Set Response 200 As Default
  7. Save your changes to your API project by Clicking File > Save (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.

What to do next