返回接口目录
学习计划/BearerWrite

Create study plan

Create a plan from explicit learning tasks. Each task binds one exact selected contentRef, a calendar date, and one of morning, afternoon, or evening; the Tool resolves current content facts and stores the execution snapshot.

Endpoint

POST/api/v1/agent/capabilities/ielts_study_plans_create

请求参数

字段类型必填说明
goalstringgoal
tasksrecord[]计划由多个已选定的学习任务组成。
tasks.contentRefunknown已选定且可排入计划的学习内容引用,由内容资源模块提供。
tasks.datestring任务所在的中国日历日期。
tasks.durationMinutesnumberdurationMinutes
tasks.timeSlotmorning | afternoon | evening任务时段:morning=上午,afternoon=下午,evening=晚上。不提供具体钟点。
titlestringtitle

调用示例

curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_study_plans_create' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $IELTS_BUDDY_TOKEN' \
  --data '{"goal":"<goal>","tasks":[]}'

请求结构

{
  "type": "object",
  "properties": {
    "goal": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
    },
    "tasks": {
      "minItems": 1,
      "maxItems": 90,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contentRef": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "question_part"
                  },
                  "partId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "partId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "mock_paper"
                  },
                  "paperId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  }
                },
                "required": [
                  "kind",
                  "paperId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "courseId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "kind": {
                    "type": "string",
                    "const": "course_section"
                  },
                  "sectionId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "courseId",
                  "kind",
                  "sectionId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "listening_dictation"
                  },
                  "partId": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "partId"
                ],
                "additionalProperties": false
              }
            ],
            "description": "已选定且可排入计划的学习内容引用,由内容资源模块提供。"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "任务所在的中国日历日期。"
          },
          "durationMinutes": {
            "default": 45,
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "timeSlot": {
            "type": "string",
            "enum": [
              "morning",
              "afternoon",
              "evening"
            ],
            "description": "任务时段:morning=上午,afternoon=下午,evening=晚上。不提供具体钟点。"
          }
        },
        "required": [
          "contentRef",
          "date",
          "durationMinutes",
          "timeSlot"
        ],
        "additionalProperties": false
      },
      "description": "计划由多个已选定的学习任务组成。"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  },
  "required": [
    "goal",
    "tasks"
  ],
  "additionalProperties": false
}

统一响应

接口结果位于 data;code 为 0 表示调用成功。

{
  "code": 0,
  "data": {},
  "message": "ok"
}

错误码

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