返回接口目录
词汇/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

请求参数

字段类型必填说明
contextstringOptional source sentence or context.
itemsrecord[]items
items.examplestringExample sentence.
items.expansionunknown[]Synonyms, collocations, or related expressions.
items.meaningstringChinese or English meaning.
items.partOfSpeechstringPart of speech.
items.phrasestringWord or phrase.
items.usagestringUsage note.
sourceIdstringStable source record id when available.
sourceTitlestringHuman-readable source title.
sourceTypestringOrigin 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"
}

错误码

40040001请求参数不符合接口契约
40140101缺少或使用了无效的访问令牌
40340301访问令牌不包含接口所需权限
40440401接口或目标资源不存在