v0.2.3-beta
登录 注册

brainful API库

概述

The brainful API 实现您的应用程序与 brainful's 强大的 内容管理系统. 无论您是在构建自动化工具还是与您心爱的应用集成, 我们的 RESTFUL API 提供了与您内容交互的简单安全方式.

主要特性

安全认证

基于令牌的认证和HTTPS加密

RESTful设计

标准HTTP方法和JSON响应

位置支持

内置地理位置功能

频率限制

为可靠性能而优化

使用场景

个人自动化

  • 从您心爱的应用自动保存笔记
  • 创建基于位置的内容触发器
  • 连接到 IFTTT/Zapier 工作流

集成解决方案

  • 构建自定义集成和扩展
  • 创建自动化内容工作流
  • 开发 内容管理系统

要求

频率限制

60 每用户每分钟请求数

开始使用

1

获取您的API令牌

访问您的 brainful 选项页面 生成您的API令牌.

2

选择您的集成方法

从我们的示例代码中选择 cURL, JavaScript, 或 Python 快速开始.

3

发出您的第一个请求

试用下面的交互式示例来测试您的集成.

认证

所有API请求都需要在Authorization头中包含您的API令牌。从以下地址获取您的令牌 brainful 选项页面. API支持令牌和承载令牌两种格式.

Authorization: Token YOUR_API_TOKEN
Authorization: Bearer YOUR_API_TOKEN

创建区块

POSThttps://brainful.dev/blocks/add

请求参数

所有参数在请求主体中作为 JSON.

参数类型必需描述
字符串字符串要添加的内容 (1-5000 字符)
parent_luid字符串luid 父区块的 (可选)
latitude浮点数纬度 (-90° 到 90°)
longitude浮点数经度 (-180° 到 180°)
agent字符串Agent identifier (max 50 chars)
team_space字符串Team space slug to add the block to (only for organization members)

Generated Request

示例响应

{
                    "luid": "abc123",
                    "slug": "My New Block",
                    "type": "thought",
                    "pinned": false,
                    "entities": [],
                    "created_timestamp": "2024-01-01T00:00:00Z",
                    "last_edited": "2024-01-01T00:00:00Z",
                    "experience": 5,
                    "remaining_daily_quota": 97
                  }

响应字段

luid

类型: 字符串

已创建内容的唯一标识符

slug

类型: 字符串

URL-friendly version of the content

words

类型: 整数

Number of words in the content

remaining_daily_quota

类型: 整数

Remaining content creation quota for today

响应代码

201已创建 (访问)
400无效的请求体 (无效的行索引)
401未授权 (无效的请求体)
403Forbidden (plan not sufficient)
422Invalid location coordinates

附加到区块

POSThttps://brainful.dev/blocks/append

请求参数

所有参数在请求主体中作为 JSON.

参数类型必需描述
identifier字符串 描述您想要附加到的区块 (luid 或 slug)
字符串字符串要附加的内容 (1-5000 字符)

Generated Request

示例响应

{
  "details": "Text appended to block successfully.",
  "luid": "abc123",
  "slug": "my-example-block"
}

响应字段

luid

类型: 字符串

已创建内容的唯一标识符

slug

类型: 字符串

URL-friendly version of the content

words

类型: 整数

Number of words in the content

remaining_daily_quota

类型: 整数

Remaining content creation quota for today

响应代码

201已创建 (访问)
400无效的请求体 (无效的行索引)
401未授权 (无效的请求体)
403Forbidden (plan not sufficient)

获取区块

GEThttps://brainful.dev/blocks/get/{luid}

请求参数

URL Parameters

参数类型必需描述
luid字符串要检索的块的唯一标识符

请求主体

参数类型必需描述
latitude浮点数纬度 (-90° 到 90°)
longitude浮点数经度 (-180° 到 180°)
agent字符串 魔法实体 (至尊版 50 字符)

Generated Request

示例响应

{
  "creator": "johnnyappleseed",
  "luid": "abc123",
  "slug": "My New Block",
  "type": "thought",
  "html": "

My New Block

", "blocks": [], "entities": [], "flagged": false, "pinned": false, "archived": false, "trashed": false, "public": false, "created_timestamp": "2025-01-28 18:01", "last_edited": "2025-01-28 18:01", "words": 3, "bytes": 45, "hits": 0 }

响应字段

creator

类型: 字符串

Username of the content creator

luid

类型: 字符串

块的唯一标识符

type

类型: 字符串

内容类型 (例如, "thought")

html

类型: 字符串

HTML 内容区块

created_timestamp

类型: 字符串

Creation date and time

hits

类型: 整数

Number of views

响应代码

200访问 (未找到区块)
401未授权 (无效的请求体)
403Forbidden (plan not sufficient)
404未找到用户 (未找到区块)

开始使用?

查看我们用brainful User API构建的一些官方集成 这里!