-
Print
-
DarkLight
-
PDF
API Gateway Path Settings
The product is currently in the Beta version and has limited availability and functionality
Path (resource) configuration settings
When creating a new API Gateway path (resource) the following settings are available:
- Path - path you want to send requests to, must start with the "/";
- Method - selects the request method. The following options are available: GET, POST, PUT, PATCH, DELETE;
When sending requests to an API path (resource) you must use the same method as you've selected in the path settings.
When Async option is disabled, it is mandatory for the process specified in the Process ID field to contain an API Call node. Remember to select POST both for the API Gateway parameter and for the Request method parameter of the API Call node.
- Process ID - ID of a process to which the request data is sent in a task;
To upload the data processed in Corezoid back to API Gateway in the Synchronous mode, you need to have an API Call node in the specified process. API Gateway provides a callback URL via the api_gateway.callback_url
field of request data, and you just need to specify the URL in an API Call node's settings:
- Description - text description of your API (optional);
- Timeout - maximum interval of API Gateway's waiting for a response from Corezoid in the Synchronous mode. Can be set to any value in the range from 0 to 29 seconds;
- Public - when enabled (default) it is required to provide a Corezoid API key for public routes in the field below. When disabled no API key is required;
- Async - when disabled (default) the Synchronous operation mode is used, and the API Gateway expects a response from Corezoid during the interval specified in the Timeout. When enabled, the API Gateway does not wait for a response from Corezoid and responds with the 204 code to a client;
- Proxy headers - when checked, request headers are sent to the specified process in a task;
- Proxy raw body - when checked, any input data format is sent in a task as a string. When unchecked, input data is sent as JSON.
Proxy raw body
In addition to a standard JSON format, you can use any format for inputting data in the API Gateway. If you need to send data to the specified process in a format other than JSON, check the Proxy raw body box and the data will be sent as a string.
However, with XML in your request body, you have a conversion option. API Gateway can convert XML data to JSON before sending it to Corezoid in a task. To send XML-format data in your request to Corezoid as JSON, just do the following:
- Select either
Application/Xml
orText/Xml
content type in the API Call node's settings; - Disable the Proxy raw body option in the API Gateway path settings.
With the Proxy raw body unchecked, the XML request:
curl -X POST -H "Content-Type: text/xml" -d '<hello>world</hello>' https://foo.api.the-company.com/bar/baz
will be forwarded to Corezoid with the following body converted to JSON:
{"hello": "world"}