API Reference

The Integry API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded and form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Setting Up

Base URL

https://api.integry.io

Server Libraries

npm install --save integry

Authentication

The Integry API requires an App-Key , User-ID and a hash of App-Secret and User-ID in the request headers to authenticate requests.

You can view and copy your App-Key and App-Secret from the Integry app.

User-ID is a unique string identifier for a user in your app. Function Calls and Integrations are associated to a user ID.

If your app has workspaces/accounts and you want integrations to be shared across all users in a workspace/account, use the workspace/account ID as the user ID.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Calculating the hash

Calculate the hash server-side using HMAC SHA256.

Making an authenticated request

Apps

List all apps

POST /apps/list

List all apps available in Integry. If you need more, please reach out!

Sample Call

Parameters

_cursor string

Paginate through apps by setting the _cursor parameter to the _cursor returned in a previous request's response. Leave empty to fetch the first page of apps. Default page size is 50.

connected_only boolean

Include as a query param to only list apps that the user has connected.

Sample Response

Returns

Returns an object[] of apps that match the criteria, and an optional _cursor to paginate over the results.

Get an app with the user's connected accounts

POST /apps/:app_name/get

Get the details of an individual app and user's connected accounts with the app by passing app_name as a path variable.

Sample Call

Sample Response

Returns

Returns the app object along with an object[] of connected_accounts of the user, if any.

Functions

List all functions

POST /functions/list

List all functions available in Integry. If you need more, make a passthrough request or reach out!

Sample Call

Parameters

app string

Include as a query param to only list functions of a an app. Eg. app=Hubspot

type string

Include as a query param to only list functions of a type. Allowed values: QUERY, ACTION, PASSTHROUGH

_cursor string

Paginate through functions by setting the _cursor parameter to the _cursor returned in a previous request's response. Leave empty to fetch the first page of functions. Default page size is 50.

connected_only boolean

Include as a query param to only list functions of apps that the user has connected.

include string

Include as a query param to get info for rendering the function UI. Allowed values: meta

Sample Response

Returns

Returns an object[] of functions that match the criteria, and an optional _cursor to paginate over the results.

Predict a function

POST /functions/predict

Use Integry to find the most relevant function based on a prompt. For more details, see Predict Function with Integry AI.

Sample Call

Parameters

prompt string Required

Prompt to use to predict function (and arguments).

_variables object

Variables to use for auto-mapping arguments.

predict_arguments boolean

Uses the prompt and optionally _variables to predict the arguments of the predicted function. See Predict Arguments with Integry AI.

include string

Include as a query param to get info for rendering the function UI. Allowed values: meta

Sample Response

Get a function

POST /functions/:function_name/get

Get the JSON schema of an individual function by passing function name as a path variable.

Sample Call

Parameters

prompt string

Prompt to use to predict arguments.

_variables object

Variables to use for auto-mapping arguments.

include string

Include as a query param to get info for rendering the function UI. Allowed values: meta

Sample Response

Returns

All supported function parameters are returned as keys, along with their type and description as key, value pairs. Required parameters are listed in the required array.

If you include a prompt, Integry AI will predict the arguments and list them in the arguments object.

If you include variables, Integry will auto-map them to the parameters and include reference tags (eg. {first_name}) in the values in the arguments object.

If you include both a prompt and _variables, Integry will predict the arguments using both the prompt and variables, adding tags where appropriate (eg. "message": "{first_name} {last_name} just signed up!")

Call a function

POST /functions/:function_name/call

Call a function by passing function_name as a path variable and the function parameters in the request body. Integry will automatically add the user's authentication credentials (eg. access token, API key) to the call.

Integry will execute the function if the user has already connected their account for the function app, and all required parameters (if any) are provided in the body. These function calls will show in the Functions > Calls Log.

Integry will not execute the function if the user has not connected an account, or the parameters passed are invalid. These function calls will not show in the Function Calls log.

Sample Call

Parameters

<function_parameters> any data type Required, if any

In most cases, you simply need to pass the parameters of the function itself when calling a function. For instance, in the sample above, channel and text are required when calling slack-post-message.

If there are no required parameters, you don't have to pass anything.

_variables object

Include if the values of any of the function parameters include variable reference tags.

_cursor string, number or object

Include if the function returns paginated data. You will get the _cursor in the response of the first call if there are additional pages.

connected_account_id number

Pass it as a query param if the user has connected multiple accounts of an app. For more, see Connect an app.

Sample Response

Returns

If Integry executes the function, it will respond with a 200 OK with following keys in the response body:

  • network_code: HTTP response status code of the onwards API call made by Integry.

  • output: HTTP response body of the onwards API call made by Integry.

  • _cursor: The cursor for the next page. It will only be present in responses of functions that support paginated calls. If there are no more pages, it will be null.

If Integry does not execute the function, it will respond with a 400 Bad Request with following keys in the response body:

  • error: Summary of the error.

  • error_details[]: Detailed errors for individual fields (if applicable).

In rare cases where Integry is unable to determine if there are more pages, it will respond with a _cursor as if there is more data to be fetched. However, your subsequent call will return an empty output[] and null _cursor which means there are no more pages.

Last updated

Was this helpful?