Skip to main content
Introduction to API Trigger settings

Configuring API Trigger

Ossi Galkin avatar
Written by Ossi Galkin
Updated over 9 months ago

API Trigger's settings

HTTP Method

The HTTP method is locked to what is defined in the OpenAPI Specification for the operation, and can be changed only by changing the OpenAPI Specification. Valid values are GET, POST, PUT, DELETE, HEAD, OPTIONS and PATCH.

URL

The url path is locked to value defined for the operation in the OpenAPI Specification, and can be changed only by changing the OpenAPI Specification. Path and query parameters are allowed.


Example of path parameter:

​ '/orders/{OrderID}': get: summary: Get one order with ID description: Returns the details of the order. parameters: - name: OrderID in: path required: true schema: type: string

Example of path parameter in the API request: GET /orders/4294

If the path parameters are of type integer or boolean, then the path will be restricted to containing only those types.

This enables having endpoints like /api/pet/{id} and /api/pet/getStatus active at the same time with no collision, if the {id} parameter is of type integer.

Example of API requests with path parameters and possible conflict of path parameter with other API operation paths:

Example API request

Comments

GET /api/pet/getStatus

Simple API operation with no path parameters. This path needs to be taken into consideration when designing the other API operations and their paths.

GET /api/pet/324

This id works, the id parameter /api/pet/{id} is integer because Frends can always link the request to /api/pet/{id} operation instead of /api/pet/getStatus.

GET /api/pet/muffet

Here the id parameter /api/pet/{id} is string, but this won't work, because there would be possibility to make request GET /api/pet/getStatus, when Frends cannot tell in unambiguous way is the request meant for GET /api/pet/getStatus or GET /api/pet/{id}.

Also, having /api/pet/{name} and /api/pet/getStatus at the same time would not be possible if the {name} parameter would be of type string.



Example of query parameter:

/now:     description: Returns current date and time.     get:       parameters:         - name: format           in: query           description: Format in wich the current date/time should be returned           schema:             type: string

Example of query parameter in the API request: GET /now?format=dd-MM-yyyy

Allowed protocols

API Triggers can be configured to accept requests with HTTP, HTTPS or both. If a request is made with a protocol that is not allowed, the reply will be Forbidden (403).

It is strongly recommended to always use HTTPS which is far more secure than using HTTP.

Allow requests from these origins (CORS)

If there is need to allow a certain page to trigger a Process, it is possible to do with cross-origin resource sharing (CORS). Check the "Allow requests from these origins" checkbox, and define the allowed origins in the textbox. The * character allows calls from all origins. Multiple origins can be provided separated with a comma(,) or semicolon(;)

Note: if the call does not come from the default port, it must be included in the origin. The origin making the call must also support CORS.

OpenAPI Document

A read-only display of the OpenAPI Specification bound to the Trigger.

Did this answer your question?