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:

  1. In the API Catalog menu, go to the API resource editing screen;

  2. Click the Create from Connector button;

  3. Select the desired connector from the list or search by its name;

  4. Check the Create using instruction option;

  5. 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:

  1. Click Add New Operation;

  2. Enter the HTTP method and path. Optionally, add a description;

  3. In the Instruction field, use the connector’s reserved words. This field has autocomplete to help you create the instruction.

resourceFromConnector addOperation
Figure 1. POST Operation for an AWS Lambda Connector

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

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

  1. Follow the instructions above to create the resource;

  2. Click Add New Operation;

  3. Select the GET method;

  4. In the Path field, enter: /users

  5. 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:

  • $headerParam.HEADER_NAME

  • $queryParam.QUERY_NAME

  • $pathParam.PATH_NAME

  • $body.ATTRIBUTE_NAME

Refer to the connector variables subsection for more details on variable syntax.

After saving the API, you can make requests to the configured resource.

Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]