CaμsAPI 接口定义

9. 校内近期重要事件获取

功能介绍:

  • 开发者通过此 API 获取近期校内重要事件(类似信息门户的倒计时通知功能)

接口: /events

请求类型:POST

请求参数:

{
    "apikey": "API Key",
    "apisecret": "API Secret Key"
}

返回结果:

  • 校内近期重要事件获取成功
Response 200
{
    "message": "Success",
    "events": [
        {
            "name": "Event Name",
            "status": "begin/end",
            "remainingdays": a number
        }
    ]
}

参数说明:

字段 含义 备注
status 距开始/距结束 值为 "begin" 或 "end"
remainingdays 距离事件开始或者结束的天数 非负整数,若为 0, 表明该事件于今天开始或者结束

参数示例:

Response 200

{
    "message": "Success",
    "events": [
        {
            "name": "16-17春 本科生预选",
            "status": "begin",
            "remainingdays": 3
        },
        {
            "name": "辅双课程认定(在院系)",
            "status": "end",
            "remainingdays": 3
        },
        {
            "name": "辅双修读费银行代扣",
            "status": "begin",
            "remainingdays": 8
        }
    ]
}

以上返回数据语义为:

距 16-17春 本科生预选 开始还有3天
距 辅双课程认定(在院系) 结束还有3天
距 辅双修读费银行代扣 开始还有8天
  • 校内近期重要事件获取失败
Response 400

{
    "message": "Failure",
    "reason": "reason for failure"
}

results matching ""

    No results matching ""