Skip to main content

Introduction

API Referencev2.0

Master the API with our comprehensive guide covering authentication, service account management, and data querying. Includes production-ready code samples in multiple programming languages.

ReactPythonJavaScriptGoC++
Quick start

This guide is structured to help you build applications quickly:

  1. Complete API Flow - Visual flowchart and step-by-step app building sequence.
  2. Authentication - JWT-based login and Service Account management.
  3. Workspaces & Workbooks - Core data operations.

πŸš€ Base URL and configuration​

All endpoints below are relative to this base URL.


πŸ”„ Complete workflow​

πŸ”

Step 1: Login

POST /idp/api/v1/user/login β†’ Extract JWT from Authorization header

πŸ”‘

Step 2: Create Service Account

Use JWT to create or reset a service account token
πŸ“Š

Step 3: Access Data

Use service account token as x-auth-token for noCo endpoints


πŸ› οΈ Developer & AI Tooling​

Leverage these resources to integrate DataGOL APIs into your workflow or allow AI agents to interact with your data.

πŸ€– AI Compatibility (OpenAPI)

Using Claude Code or Cursor? Feed them this spec to make the API "self-understandable".

Download OpenAPI Spec

πŸ“¬ Postman Collection

Test all endpoints instantly. Includes pre-configured environment variables and example bodies.

Download Postman Collection

πŸ”„ Application Lifecycle

Understand the step-by-step sequence of API calls required to build a full application.

View API Flow

AI Tip

In Cursor or Claude Code, you can simply point the tool to the downloaded openapi.yaml to help it generate precise API integration code for your project.


πŸ“‹ Common headers​

Endpoint TypeRequired HeadersExample
All RequestsContent-Type: application/jsonContent-Type: application/json
IdP EndpointsAuthorization: Bearer <JWT>Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
noCo Endpointsx-auth-token: <service-token>x-auth-token: sa_1234567890abcdef...

⚠️ Security and error handling​

πŸ”’ Token Security

  • Treat all tokens as secrets - never commit to source control
  • Prefer tokens with expiry over non-expiring tokens
  • Rotate tokens regularly for enhanced security

πŸ”„ Error Handling

  • Handle HTTP 401/403 by refreshing JWT or resetting service account token

  • Use HTTPS only (all endpoints are https://)

  • Implement proper error logging and monitoring

πŸ’» Code samples​

Before Running

Replace placeholders like YOUR_JWT, YOUR_SERVICE_TOKEN, YOUR_WORKSPACE_ID, and YOUR_TABLE_ID with your actual values.

import React, { useEffect, useState } from "react";

export default function QueryTable() {
const [rows, setRows] = useState([]);
const [loading, setLoading] = useState(false);
const token = process.env.REACT_APP_SERVICE_TOKEN;
const workspaceId = "YOUR_WORKSPACE_ID";
const tableId = "YOUR_TABLE_ID";

useEffect(() => {
async function run() {
setLoading(true);
try {
const res = await fetch(
`https://be.datagol.ai/noCo/api/v2/workspaces/${workspaceId}/tables/${tableId}/executeQuery`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-auth-token": token,
},
body: JSON.stringify({ value: "SELECT * FROM table_6ec53cc4" }),
},
);
const data = await res.json().catch(() => ({}));
setRows(data.rows || []);
} catch (e) {
console.error(e);
} finally {
setLoading(false);
}
}
run();
}, [token, workspaceId, tableId]);

if (loading) return <div>Loading…</div>;
return (
<table>
<tbody>
{rows.map((r, i) => (
<tr key={i}>
{Object.values(r).map((v, j) => (
<td key={j}>{String(v)}</td>
))}
</tr>
))}
</tbody>
</table>
);
}

Was this helpful?