Add URL parameters in API operations

In this topic, you learn how to add URL parameters in an API operation of an external API. API operations are defined for an API in the API Designer.

In this task, you perform the minimum steps to add URL parameters. For more information on how to add operations, see Add an operation.

Prerequisites

Procedure

  1. In the Cockpit, go to Connectivity and select API Designer.

  2. From the table, select the external API that you want to add URL parameters to.

  3. In the Operations tab, select + to add an operation.

  4. In Path, enter a slash and the name of an end path for the external API, then add another slash and the parameter in parentheses, for example, /planets/(planetId).

  5. In Method, select a method from the list, for example GET.

  6. Go to the Request tab.

  7. In the Parameters section, select + to define a parameter.

  8. In Name, enter the parameter you added in the path, for example, planetId.

  9. Activate in Path.

    When this operation is executed, the value will replace the parameter in the URL. For example, if the operation /planets/(planetId) is executed with the value 1, the request will be /planets/1.
  10. Select Save.

Results

  • You have added a URL parameter to an API operation.