Mapping the API Request to the z/OS Asset

How to map the API request to the z/OS Asset.

Before you begin

The following tasks must be completed:
  1. Prepare the sample IMS application.
  2. Starting the z/OS Connect Designer with Docker Desktop and importing an OpenAPI definition.
  3. Configuring connections to IMS with Docker Desktop and Basic Authentication.
  4. Define the GET operation for the /phonebook/contacts/{lastName} path.
  5. Reusing the phonebook z/OS Asset.

About this task

This topic is applicable to: z/OS Connect Designer
capability Content applicable to
application developers

In this task, you map the API request parameters to the fields in the z/OS Asset.

Procedure

  1. Open the PUT /phonebook/contacts/{lastName} method Operation flow diagram.
    Expand the /phonebook/contacts/{lastName} path in the navigation tree and click PUT. The PUT /phonebook/contacts/{lastName} operation is displayed.
  2. Click the Request node in the Operation flow diagram.
    The API request structure displays the parameters and the body of the request that are expanded by default.

    Within Parameters, there is one parameter that is called lastName as defined in the OpenAPI definition. Click Down arrow to expand and see more details about this parameter.

    Figure 1. Viewing the API request parameters.
    Viewing the API request parameters.
  3. Click the phonebook z/OS Asset node in the Operation flow diagram.
    The z/OS Asset configuration window opens.
    Figure 2. Open the z/OS Asset node
    Open the z/OS Asset node
    1. Enter UPDATE into the IN-COMMAND field
      UPDATE

      This value is required by the IMS Phonebook application to update a contact.

    2. Map the API Request Parameter lastName into the IN-LAST-NAME z/OS Asset request field.

      Enter lastName in the IN-LAST-NAME field. When you start typing, the Available Mappings menu opens with the available parameters. Select lastName from the list.

      You do not have to type the parameter names. To the right of each text box are two icons:
      • Click Insert a mapping icon to select a Path parameter from the list. When the list opens, be sure that you look in the correct group.
      • Click Insert a function icon to insert a function. Functions are not used in this tutorial. For more information, see Mapping your API and z/OS Assets.
    3. Map the API Request body field firstName into the IN-FIRST-NAME z/OS Asset request field.
    4. Map the API Request body field extension into the IN-EXTENSION z/OS Asset request field.
    5. Map the API Request body field zipCode into the IN-ZIP-CODE z/OS Asset request field.
      Figure 3. Completed mappings for the phonebook PUT input fields.
      Completed mappings for the phonebook PUT input fields.
  4. Optional: Review other information about this request within the phonebook window.
    1. Click View structure to see the request schema.
    2. Click Response to view the response schema.
    3. Click z/OS Asset details to view the z/OS Asset configuration details.

Results

The API request parameters are successfully mapped to the fields in the z/OS Asset.

What to do next

Defining the PUT /phonebook/contacts/{lastName} responses.