Skip to main content

Getting started with API

Overview

Integrations use the API to access Comind's apps, app records, and users.

Integrations can connect various services to Comind and build interactive experiences for users within Comind.

Conventions

The base URL to send all API requests is https://api.comindwork.com/api. HTTPS is required for all API requests.

For the self-hosted installation - the API requests should be sent to the locally defined domain.

The Comind API follows RESTful conventions when possible, with most operations performed via GET and POST requests on database resources. Request and response bodies are encoded as JSON.

Authentication

Requests use the HTTP Authorization header to authenticate the user and authorize operations. The Comind API accepts bearer tokens in this header. Bearer tokens are provided to you when you create an integration.

curl ^
--request GET ^
--url "https://api.comindwork.com/api/w/METAMETA/a/WORKSPACE/tickets/list" ^
--header "Authorization:CMW_AUTH_CODE YOUR-AUTH-CODE-GOES-HERE

Inside Comind, users will see updates made by integrations attributed to the user credentials used for integration. Normally special "bot" users are created - and their names, avatar, access-levels and permissions to perform operations are controlled in the user administration.

Using a Comind SDK for TS - available at https://www.npmjs.com/package/@comind/api - a bearer token can be passed once to initialize the client and can be used to send multiple authenticated requests.

// npm i @comind/api
const genericApiAuthToken = process.env.CMW_AUTH_CODE_GENERIC || "...";
const comind = new Comind();
comind.setLoadAccessToken();
const data = await comind.records.retrieve(
`w/METAMETA/a/WORKSPACE/tickets/list`,
{
limitRecords: 1,
listOfFields: "project_id",
}
);
console.log(data);