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

Replan study plan

Replace the unfinished learning tasks of one plan in one transaction. The plan keeps its identity and completed work; each new task uses an exact selected contentRef and a morning, afternoon, or evening slot.

Endpoint

POST/api/v1/agent/capabilities/ielts_study_plans_replan

请求参数

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

调用示例

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

请求结构

{
  "type": "object",
  "properties": {
    "next": {
      "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,
      "description": "Complete next arrangement for this plan."
    },
    "planId": {
      "type": "string",
      "minLength": 1
    },
    "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    }
  },
  "required": [
    "next",
    "planId",
    "reason"
  ],
  "additionalProperties": false
}

统一响应

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

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

错误码

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