Skip to Content
DocumentationFeatureThird-party API

Third-party API

This document explains all publicly available API interfaces. All requests start with /tp.

💡
By default, this is the method referenced by Python packages.

All interfaces on this page must include the following request headers

HeaderValue
API-KEYyour api key

/tp/section/label/create

Create a column label

Parameters

ParameterTypeRequiredDescription
namestringYesLabel name

Example Code

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/section/label/create", headers=headers, json={ "name": "test" } )

/tp/section/mine/all

Get all my columns


/tp/document/label/list

Get all document labels


/tp/document/label/create

Create a document label

Parameters

ParameterTypeRequiredDescription
namestringYesLabel name

Example Code

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/document/label/create", headers=headers, json={ "name": "test" } )

/tp/document/create

Create a document

Parameters

ParameterTypeRequiredDescription
categoryintYesDocument type: 0: File document, 1: Link document, 2: Quick note document
from_platstringYesSource platform, must be api
sectionsint[]YesColumn groups
auto_summarybooleanNoWhether to auto-generate summary
labelsint[]YesLabel groups
urlstringNoURL, required for link documents and only valid for link documents
contentstringNoContent, required for quick note documents and only valid for quick note documents
file_namestringNoFile path (essentially a subpath, must be in file/{filename} format), required for file documents and only valid for file documents

Example Code

This code is only for link document examples. Please modify for other document types.

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/document/create", headers=headers, json={ "category": 1, "from_plat": "api", "sections": [], "auto_summary": True, "labels": [], "url": "https://baidu.com" } )

/tp/notification/create

Create a notification

Parameters

ParameterTypeRequiredDescription
titlestringYesNotification title
contentstringYesNotification content
linkstringYesNotification link
notification_typeintYesNotification type, 0 for system notification

Example Code

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/notification", headers=headers, json={ "title": "test", "content": "test", "link": "/dashboard", "notification_type": 0 } )
Last updated on