-
Print
-
DarkLight
-
PDF
How to Create an API and a Path for API Requests
The product is currently in the Beta version and has limited availability and functionality
To create your own API and a path for API requests, do the following:
1. Click + New Endpoint, fill in the API name input field, and click Add
2. Click on the new endpoint after it appears in the sidebar, and click "Add Resource"
3. Fill out the path (resource) input fields:
- Path - enter the path that starts with the "/";
- Method - select the method for sending requests;
With the Async option disabled, it is mandatory for the process specified in the Process ID field to contain an API Call node. You must select POST in the API Gateway Method parameter, and select POST in the Request method parameter of the API Call node.
- Process ID - copy an ID of a process (conv_id) in Corezoid to which you want to send tasks and paste it into this field;
With the Async option disabled, you need to use the following construction in the URL field of the API Call node: {{api_gateway.callback_url}}
3.1 You also can add the following:
- Request parameters - are returned in API Gateway request;
- Custom http code to the response headers - use the
CZ-AG-Status-Code
key:
- Description - you can add a description for the resource;
- Timeout - interval of waiting for a response;
- Async - task will be sent without waiting for a responce;
- proxy headers - add to response in "request" parameter sub parameter "headers";
- proxy raw body - add to response in "request" parameter sub parameter "raw_body" - body raw object from request.
After you've filled the input fields, click Add.
4. Share the process with an API Key
Grant the API Key user the Task management right to the process specified in the Process ID field:
5. Copy the base URL
Add one of the paths you've created earlier:
6. Send an API request using the basic authorization
Username is the API key login
Password is the API key secret key: