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
-
You have configured an external API.
Procedure
-
In the Cockpit, go to Connectivity and select API Designer.
-
From the table, select the external API that you want to add URL parameters to.
-
In the Operations tab, select + to add an operation.
-
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)
. -
In Method, select a method from the list, for example
GET
. -
Go to the Request tab.
-
In the Parameters section, select + to define a parameter.
-
In Name, enter the parameter you added in the path, for example,
planetId
. -
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 value1
, the request will be/planets/1
. -
Select Save.