Configuring an operation

One or more HTTP operations together form a Path. These operations are different ways of interacting with an API and you can use GET, POST, PUT, DELETE, HEAD, PATCH, and OPTIONS operations.

About this task

You can complete this task either by using either the API Designer UI application, or by using the browser based API Manager UI.

An operation must have at least one success response defined.

Procedure

To configure an operation, complete the following instructions:

  1. In the navigation pane, click Develop icon in the API UI navigation pane Develop, then select the APIs tab.
  2. Click the REST API definition that you want to work with.
  3. Click Paths, click the required Path, then click the required operation.
    The details page for the operation opens.
  4. Optional: In the Operation Id field, provide an identifier for your operation. The operation ID must not be shared by any other operations.
  5. Optional: In the Summary field, provide a summary of your operation.
  6. Optional: In the Tags field, add any tags that you want to associate your operation with.
    The tags are included in the OpenAPI definition file for the API, and can be used to group operations in the Developer Portal by using the filter options for the API.
  7. Optional: In the Description field, provide a description of your operation.
  8. Specify which security definitions to apply to your operation. By default, all the security definitions that have been configured for the API are applied to the operation. To select which of the API security definitions you want to apply to the operation, complete the following steps:
    1. Select Override API Security Definitions.
      An Add button is displayed.
    2. Click Add, then select the required security definitions.
  9. Specify the media types that the operation produces. By default, the operation produces the same media types as those that have been defined for the API. To specify the required media types, select Override API Produce Types; you can select JSON and XML, which are supported by API Connect, and you can add another media type in the Add media Type field.
  10. Specify the media types that the operation consumes. By default, the operation consumes the same media types as those that have been defined for the API. To specify the required media types, select Override API Consume Types; you can select JSON and XML, which are supported by API Connect, and you can add another media type in the Add media Type field.
  11. Optional: Add any parameters that are specific to this operation, by completing the following steps:
    1. In the Parameters section, click Add.
    2. In the NAME field, provide a name for your parameter.
      Note: The query parameters appId, client_id, client_secret, and appSecret are reserved and cannot be used.
    3. In the LOCATED IN field, select where the parameter is located when your operation is called.
    4. Optional: From the TYPE drop-down list, select the type of data that the parameter is expected to have when the call is received by API Connect. If you have set LOCATED IN to body then you can select a JSON schema that you have defined for your API. For more information about creating JSON schemas, see Step 6 of Editing an API definition.
    5. Optional: In the DESCRIPTION field, provide a description of your parameter.
    6. Use the REQUIRED check box to specify whether the parameter is required for a call to be valid.
      Note: If you specify that a parameter is required, the required field for the parameter in the OpenAPI definition file is set to true, so that the requirement is documented for consumers of the API. The requirement is not enforced by the IBM® API Connect Gateway

      However, the requirement is enforced by the Developer Portal test tool, because the purpose of these tools is to explore the correct operation of the API.

  12. Add or edit any responses that you want to include.
    These responses are only for the OpenAPI definition of your API that is provided to developers and are not used for any purposes other than documentation.
    1. In the Response section, click Add.
    2. In the STATUS field, provide the HTTP status code that might be returned.
    3. Optional: If you have defined any JSON schemas for your API, you can select to reference one of them from the SCHEMA drop-down list. For more information on creating JSON schemas, see Step 6 of Editing an API definition.
    4. In the DESCRIPTION field, provide text to be returned for the specified status code.
  13. Click Save to save your changes.

Results

You have configured your operation and can add more operations to your Path.