Create from Connector
You can create resources from connectors that are enabled on the platform. Read more about connectors and how to enable them.
To create a resource from a connector:
-
In the API Catalog menu, go to the API resource editing screen;
-
Click the Create from Connector button;
-
Select the desired connector from the list or search by its name;
-
Check the Create using instruction option;
-
Add the resource name (required) and an optional description.
After creating the resource, you’ll be redirected to the editing screen, where you can add operations to the resource:
-
Click Add New Operation;
-
Enter the HTTP method and path. Optionally, add a description;
-
In the Instruction field, use the connector’s reserved words. This field has autocomplete to help you create the instruction.
![resourceFromConnector addOperation](_images/resourceFromConnector-addOperation.png)
In the example above, we are creating a POST operation for an AWS Lambda connector, which will respond in the resource /aws
.
The Instruction field includes the information expected by the function.
The saved resource in the API will have a connector label linked to it:
![resourceFromConnector resourceLabel](_images/resourceFromConnector-resourceLabel.png)
The API must be deployed to the same environment in which the connector is configured. Deploy the API on the Environments section of the API’s Overview screen.
![resourceFromConnector environments](_images/resourceFromConnector-environments.png)
The Instruction field understands the native syntax of the protocol to which the connector enables access.
For example, for database connectors, an Oracle connector does not allow ; at the end of the instruction, while a MySQL connector does.
|
Another example of this step is the image below. In this case (of a SQL connector), the registered operation will return a database table query.
Example with SQL Connector
Creating an operation with the SQL connector to return a query on a database table:
-
Click Add New Operation;
-
Select the
GET
method; -
In the Path field, enter:
/users
-
In the Instruction field, enter:
select * from users $body.syntaxsql
The result will be a JSON with the query data from the users table following the provided instruction.
You can use header, path, query or body parameters in the instruction. Use the following variables:
Refer to the connector variables subsection for more details on variable syntax. |
After saving the API, you can make requests to the configured resource.
Share your suggestions with us!
Click here and then [+ Submit idea]