词汇/BearerWrite
Add personal vocabulary
Add or enrich up to 100 words directly in the current user's personal vocabulary book while recording their source.
Endpoint
POST
/api/v1/agent/capabilities/ielts_vocabulary_personal_add请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| context | string | 否 | Optional source sentence or context. |
| items | record[] | 是 | items |
| items.example | string | 否 | Example sentence. |
| items.expansion | unknown[] | 否 | Synonyms, collocations, or related expressions. |
| items.meaning | string | 否 | Chinese or English meaning. |
| items.partOfSpeech | string | 否 | Part of speech. |
| items.phrase | string | 是 | Word or phrase. |
| items.usage | string | 否 | Usage note. |
| sourceId | string | 否 | Stable source record id when available. |
| sourceTitle | string | 否 | Human-readable source title. |
| sourceType | string | 否 | Origin such as agent, reading_lexicon, practice, or course. |
调用示例
curl -X POST \
'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_vocabulary_personal_add' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $IELTS_BUDDY_TOKEN' \
--data '{"context":"","items":[],"sourceId":"","sourceTitle":"","sourceType":"agent"}'请求结构
{
"type": "object",
"properties": {
"context": {
"default": "",
"description": "Optional source sentence or context.",
"type": "string"
},
"items": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"example": {
"default": "",
"description": "Example sentence.",
"type": "string"
},
"expansion": {
"default": [],
"description": "Synonyms, collocations, or related expressions.",
"maxItems": 30,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"meaning": {
"default": "",
"description": "Chinese or English meaning.",
"type": "string"
},
"partOfSpeech": {
"default": "",
"description": "Part of speech.",
"type": "string"
},
"phrase": {
"type": "string",
"minLength": 1,
"maxLength": 300,
"description": "Word or phrase."
},
"usage": {
"default": "",
"description": "Usage note.",
"type": "string"
}
},
"required": [
"example",
"expansion",
"meaning",
"partOfSpeech",
"phrase",
"usage"
],
"additionalProperties": false
}
},
"sourceId": {
"default": "",
"description": "Stable source record id when available.",
"type": "string"
},
"sourceTitle": {
"default": "",
"description": "Human-readable source title.",
"type": "string"
},
"sourceType": {
"default": "agent",
"description": "Origin such as agent, reading_lexicon, practice, or course.",
"type": "string",
"minLength": 1,
"maxLength": 80
}
},
"required": [
"context",
"items",
"sourceId",
"sourceTitle",
"sourceType"
],
"additionalProperties": false
}统一响应
接口结果位于 data;code 为 0 表示调用成功。
{
"code": 0,
"data": {},
"message": "ok"
}错误码
400
40001请求参数不符合接口契约401
40101缺少或使用了无效的访问令牌403
40301访问令牌不包含接口所需权限404
40401接口或目标资源不存在