How to Create an API and a Path for API Requests
  • 20 Mar 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How to Create an API and a Path for API Requests

  • Dark
    Light
  • PDF

Beta version

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

new API.gif

2. Click on the new endpoint after it appears in the sidebar, and click "Add Resource"

instr2.png

3. Fill out the path (resource) input fields:

new API 2step.gif

  1. Path - enter the path that starts with the "/";
  2. Method - select the method for sending requests;
Method for the Synchronous operation

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.

  1. 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;
Construction used in API Call node URL

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:

instr3.png

  • 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:

instr4.png

5. Copy the base URL

Add one of the paths you've created earlier:

instr5.png

6. Send an API request using the basic authorization

instr6.png

Username is the API key login

Password is the API key secret key:

instr7.png

7. Check whether the task was sent

postman screen.png