Working with Path and Query Parameters
ActiveMatrix BusinessWorks REST APIs support path and query parameters. You can apply path parameters only at the root level and not at individual operation level. You can apply query parameters at root as well as individual operation level.
/book/{isbn}
In this example, the client would invoke this service using the URL http:/<host>:<port>/book/<isbn>.
Insert a question mark (?) after a parameter to add query parameters to a resource. In the following example, isbn is defined as a query parameter, instead of the path parameter, in the resource service path:
/book?{isbn}
Insert (&) to use it as a delimiter when defining multiple query parameters. In the following example, the query parameters isbn and authorName are defined in the resource service path:
/book?{isbn}&{authorName}
All the parameters defined in the resource service path are made available to the user as Input for every operation. See the following image for the /book/{isbn} example to see the Input for the GET operation.
/books/{isbn}?{isbn}
If the Request Format for a REST Binding is Form, the parameter name must be different from all element names in the referenced schema. For example if a Books schema contains the element isbn, isbn cannot be used as query or path parameter name.
use: /books/Emma?author,isbn,price
not: /books/Emma?fields=author,isbn,price
Adding or Editing Path Parameters
You can create or modify path parameters for REST services that were created in the TIBCO Business Studio for BusinessWorks using an XSD. For REST services that were created using a Swagger file that was imported from an external source, you can only view the parameters that its operations support. You cannot create or modify the parameters for such services.
Procedure
Adding or Editing Query Parameters
You can create or modify query parameters for REST services that were created in the TIBCO Business Studio for BusinessWorks using an XSD. For REST services that were created using a Swagger file that was imported from an external source you can only view the parameters that its operation supports. You cannot create or modify the parameters in such services.
Procedure
- Click Components under the Module Descriptors to open the Component Configurations page.
- Expand the Component<application_name> node.
- Double-click the process name (with the green chevron next to it) to open its properties in the Properties view.
- Click the Bindings tab.
- Click an operation name in the Operations section.
- Click the Request tab in the Operation Details section.
- Click the green icon () to add a query parameter. To edit the parameter name click on the newly created parameter's default name and type in a new name. Be aware that these buttons are disabled if you are viewing operations in an API that was created outside the TIBCO Business Studio for BusinessWorks and imported into the TIBCO Business Studio for BusinessWorks.
- You can also edit the existing query parameter to make it required or optional by clicking in the cell that corresponds to the parameter in the Required column. The value toggles from Yes to No or vice versa.