product
API

API

Edicek provides a GraphQL API that gives you programmatic access to all the functionality available in the app. You can save content, search your workspace, manage collections, and perform any other operation you would normally do through the interface.

Getting Started

Personal Access Tokens

To use the API, you'll need a Personal access token. You can create and manage your tokens in the app:

Step 1: Click on your user button in the top right corner of the app

Step 2: Open your Profile page

Step 3: Navigate to the tokens section where you can create and manage your Personal access tokens

API Endpoint

The GraphQL server is available at:

https://my.edicek.com/api/graphql

This endpoint also includes a GraphQL Playground where you can explore the API and test queries interactively.

Authentication

All API requests require authentication using your Personal access token. Include the following headers in your requests:

Authorization header:

Authorization: Bearer YOUR_TOKEN_HERE

Workspace header:

If you're performing operations that involve reading or manipulating data within a specific workspace, you'll need to include the workspace ID:

workspace: WORKSPACE_ID

Getting Your Workspace ID

You can retrieve your workspace IDs using this query:

query {
  workspaces {
    id
    title
  }
}

Example Requests

Getting Your Workspaces

Here's an example of how to retrieve your workspaces:

curl -X POST https://my.edicek.com/api/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -d '{"query": "{ workspaces { id title } }"}'

Querying Workspace Data

Here's an example of querying chats within a specific workspace (requires workspace header):

curl -X POST https://my.edicek.com/api/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "workspace: WORKSPACE_ID" \
  -d '{"query":"query ($pagination: PaginationInput!) {\n  chats(pagination: $pagination) {\n    pagination {\n      totalCount\n      __typename\n    }\n    __typename\n  }\n}","variables":{"pagination":{"limit":1,"page":1}}}'