请求方式:POST(HTTPS)
请求地址:订阅方提供
Content-Type:application/json
请求参数:
| 参数 | 说明 |
|---|---|
| msg_signature | 加密签名 |
| encrypt | 加密的消息体 |
| timeStamp | 加密时间戳 |
| nonce | 加密随机码 |
示例:
{
"msg_signature":"e802c00e011cf677668f20a8bf1d681a9066bbc7",
"encrypt":"2sA+\/i7+tnZhouraUeldQ5dwnJ9K1xFUtur8aybY5kclObpe3mCpUsctILSCDL\/z+l1CNMwPuHEyUwhf3lMMNd2IQhVKa3SB8CeVyGW\/6BiD9httSIk7KLJ\/BjuFc8kTCtXS\/l7aYG8Ea4cC2WQq1Bw62YLMdrLS9fTAxPiZ2NVtMvypFpYBboR1PXxVdr7uMaJcyEb1eZvB\/A0bjqSrS0aNXDZYmi6AlSF3Q4KlVctciw1OX9WxnfvkbzQwDk0FQqQxlUkKR+QEw7i5MN4v3YARPcC8GIh1jfFTEuo5rB8KXakbzsLJeVrpmJ7sGoegXvnrPKUnPlntgnWHmQu5IQ==",
"timeStamp":1618453647,
"nonce":"oLWdCnoO4YZQGUoO"
}
消息体解密后示例:
{
"company_id":"dingbidetu",
"event_action":"learn_start",
"event_time":"1618453646395",
"course_id":"3701236331520018",
"lesson_id":"370733440013",
"dept_user_id":"3141543358"
}
订阅方根据解密后JSON的event_action字段判断消息类型,并结合其它字段信息进行后续逻辑的处理。每一种event_action对应的标识名及携带的字段信息下文有详细说明。
针对所有的订阅事件,在您收到事件推送后,务必返回包含“success”的加密的字符串给授客开放平台,只有返回了该数据,授客开放平台才会判断此事件推送成功。 具体返回给授客开放平台的JSON数据示例如下:
{
"msg_signature":"111108bb8e6dbce3c9671d6fdb69d1506xxxx",
"timeStamp":"1783610513",
"nonce":"123456",
"encrypt":"1ojQf0NSvw2WPvW7LijxS8UvISr8pdDP+rXpPbcLGOmIxxxx"
}
返回的JSON数据包含的字段与事件推送是一样的,其中encrypt为“success”字符串加密后的值,具体加密算法详见加解密算法文档。
当授客开放平台收到的加密返回值解密后不包含“success”字符串时,会认为事件推送失败,将启动重试推送事件机制。共重试9次推送,重试推送的间隔频率是:15s、3m、10m、30m、30m、1h、2h、6h、15h。
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 message_push 消息通知推送 |
| event_time | Int | 事件触发时间,单位毫秒 |
| userid | Array | 消息接收userid数组 |
| title | String | 消息标题 |
| content | String | 消息内容,可为空 |
| image_url | String | 消息封面图URL |
| link_url | Array | 消息链接数组 |
| pc | String | PC端URL |
| h5 | String | 移动端URL |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "message_push",
"event_time": 1609957197000,
"userid": [
"zhansan",
"lisi",
],
"title": "线上课:公司企业文化",
"content": "管理员为您安排了1门线上课,请在截止日期内完成,别忘记学习哦!",
"image_url": "https://cdn.xxx.com/course_assign.png",
"link_url": {
"pc": "https://saas.eduto.com/pcHome/dist/ssoLogin?gotoUrl=CourseDetail&uuid=9A10919A-52B8-4355-8C3A-1D171C537D82&type=normal",
"h5": "https://saas.eduto.com/mobile/dist/ssoLogin?gotoUrl=courseDetail&uuid=9A10919A-52B8-4355-8C3A-1D171C537D82&type=normal&lessonType=normal&showqr=1",
},
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 todo_create 创建待办 todo_delete 删除待办 |
| event_time | Int | 事件触发时间,单位毫秒 |
| dept_user_id | String | 用户UserID |
| record_id | String | 待办ID,最大长度36字符 |
| title | String | 待办标题(仅创建待办事件有此字段) |
| target_id | String | 关联模块资源ID |
| module | String | 待办模块 learning_map 学习地图 training 线下培训 exam 考试 course 线上课 |
| link_url | Array | 待办链接数组(仅创建待办事件有此字段) |
| pc | String | PC端URL |
| h5 | String | 移动端URL |
解密后消息体样例:
//创建待办
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "todo_create",
"event_time": 1609957197000,
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"record_id": "472E80BE-7700-4399-91B6-7415C97A0E52",
"title": "线下培训:公司企业文化",
"target_id": "9A10919A-52B8-4355-8C3A-1D171C537D82",
"module": "training",
"link_url": {
"pc": "https://saas.eduto.com/pcHome/dist/ssoLogin?gotoUrl=CourseDetail&uuid=9A10919A-52B8-4355-8C3A-1D171C537D82&type=normal",
"h5": "https://saas.eduto.com/mobile/dist/ssoLogin?gotoUrl=courseDetail&uuid=9A10919A-52B8-4355-8C3A-1D171C537D82&type=normal&lessonType=normal&showqr=1",
}
}
//删除待办
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "todo_delete",
"event_time": 1609957197000,
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"record_id": "472E80BE-7700-4399-91B6-7415C97A0E52"
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 course_create 课程创建 course_edit 课程更新 course_publish 课程发布 course_delete 课程删除 |
| event_time | Int | 事件触发时间,单位毫秒 |
| uuid | String | 课程唯一ID,最大长度36字符 |
| title | String | 课程标题,最大长度255字符 |
| category_id | String | 课程分类ID,最大长度36字符 |
| certificate_id | String | 关联证书ID,最大长度36字符 |
| study_type | Int | 学习模式: 1 自由式 2 解锁式 |
| credit | Decimal(12,2) | 学分数量 |
| point | Decimal(12,2) | 积分数量 |
| status | Int | 课程发布状态: -1 删除 0 未发布 1 已发布 2 关闭 |
| lesson_num | Int | 课件数量,最大位数11 |
| total_length | Int | 学时长度,单位秒 |
| description | String | 课程描述,最大长度65535字符 |
| create_time | Int | 创建时间,Unix时间戳,单位毫秒 |
| update_time | Int | 更新时间,Unix时间戳,单位毫秒,如果status为-1或者2,此为最后操作时间 |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "course_create",
"event_time": 1609957197000,
"uuid": "F6685184-15A0-469C-89A2-3C2C8EF2CAA4",
"title": "党建课程六建议分类",
"category_id": "",
"certificate_id": "",
"study_type": 1,
"credit": 0.00,
"point": 0.00,
"status": 1,
"lesson_num": 1,
"total_length": 10,
"description": "",
"type": "normal",
"lesson_type": "normal",
"create_time": 1609957197000,
"update_time": 1609957197000
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 course_lesson_create 课件创建 course_lesson_edit 课件编辑 course_lesson_delete 课件删除 |
| event_time | Int | 事件触发时间,单位毫秒 |
| uuid | String | 课件唯一ID,最大长度36字符 |
| title | String | 课件标题,最大长度255 |
| type | String | 课件类型: video视频 audio音频 document文档等 video test document audio article home_work link image pptx docx jpg text doc ppt xls xlsx txt |
| test_id | String | 小测验id,最大长度36字符 |
| credit | Decimal(12,2) | 学分数量 |
| point | Decimal(12,2) | 积分数量 |
| course_id | String | 所属课程ID,最大长度36字符 |
| create_time | Int | 创建时间,Unix时间戳,单位毫秒 |
| length | Int | 课件长度,单位秒,最大位数11 |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "course_lesson_create",
"event_time": 1609957197000,
"uuid" : "课程唯一ID",
"title" : "课程标题",
"type" : "document",
"test_id": "0CAAA346-727D-4030-BAE6-4169D0E1664D",
"credit": 0.00,
"point" : 5.00,
"course_id": "41121033-3F87-48E3-B1B7-EBEF3339B8C2",
"create_time": 1546565453000,
"length": 120
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 learningmap_create 学习地图创建 learningmap_edit 学习地图更新 learningmap_publish 学习地图发布 learningmap_delete 学习地图删除 |
| event_time | Int | 事件触发时间,单位毫秒 |
| uuid | String | 学习地图唯一ID,最大长度36字符 |
| title | String | 学习地图标题,最大长度255字符 |
| category_id | String | 学习地图分类ID,最大长度36字符 |
| certificate_id | String | 关联证书ID,最大长度36字符 |
| type | String | 周期类型: fixed 固定时间 cycle 周期型 |
| status | Int | 考试状态: -1 删除 0 未发布 1 已发布 2 关闭 |
| stage_number | Int | 阶段数量,最大位数11 |
| open_time | Int | 地图开启时间(仅type=fixed时有意义),Unix时间戳,单位毫秒 |
| end_time | Int | 地图结束时间(仅type=fixed时有意义),Unix时间戳,单位毫秒 |
| learning_num | Int | 学习人数,最大位数11 |
| finish_num | Int | 完成人数,最大位数11 |
| create_time | Int | 创建时间,Unix时间戳,单位毫秒 |
| update_time | Int | 更新时间,Unix时间戳,单位毫秒,如果status为-1或者2,此为最后操作时间 |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "learningmap_create",
"event_time": 1609957197000,
"uuid": "2A09EBF2-A8D9-4BDF-8D60-FADE743E1777",
"title": "学习地图标题2",
"category_id": "1C09EBF2-A8D9-4BDF-8D60-FADE743E1508",
"certificate_id": "200619E7-5004-464D-A80A-D9D2DFA4F272",
"type":"fixed",
"status": 1,
"stage_number": 5,
"open_time": 1546565453000,
"end_time": 1609957197000,
"learning_num": 100,
"finish_num": 80,
"create_time": 1609957197000,
"update_time": 1609957197000
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 training_create 线下培训创建 training_edit 线下培训更新 training_publish 线下培训发布 training_delete 线下培训删除 |
| event_time | Int | 事件触发时间,单位毫秒 |
| uuid | String | 线下培训唯一ID,最大长度36字符 |
| title | String | 线下培训标题,最大长度255字符 |
| category_id | String | 线下培训分类ID,最大长度36字符 |
| certificate_id | String | 关联证书ID,最大长度36字符 |
| status | Int | 考试状态: -1 删除 0 未发布 1 已发布 2 关闭 |
| lector_id | String | 关联讲师ID,最大长度36字符 |
| enroll_num | Int | 报名人数,最大位数11 |
| train_start_time | Int | 培训开始时间,Unix时间戳,单位毫秒 |
| train_end_time | Int | 培训结束时间,Unix时间戳,单位毫秒 |
| enroll_start_time | Int | 报名开始时间,Unix时间戳,单位毫秒 |
| enroll_end_time | Int | 报名结束时间,Unix时间戳,单位毫秒 |
| training_num | Int | 培训人数,最大位数11 |
| create_time | Int | 创建时间,Unix时间戳,单位毫秒 |
| update_time | Int | 更新时间,Unix时间戳,单位毫秒,如果status为-1或者2,此为最后操作时间 |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "training_create",
"event_time": 1609957197000,
"uuid": "2A09EBF2-A8D9-4BDF-8D60-FADE743E1777",
"title": "线下培训标题",
"category_id": "1C09EBF2-A8D9-4BDF-8D60-FADE743E1508",
"certificate_id": "200619E7-5004-464D-A80A-D9D2DFA4F272",
"status": 1,
"lector_id": "363FED3E-D1CC-4FE5-A9CD-65A0C44889CE",
"enroll_num": 10,
"train_start_time": 1546565453000,
"train_end_time": 1609957197000,
"enroll_start_time": 1546565453000,
"enroll_end_time": 1609957197000,
"create_time": 1609957197000,
"update_time": 1609957197000
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 exam_create 考试创建 exam_edit 考试更新 exam_publish 考试发布 exam_delete 考试删除 |
| event_time | Int | 事件触发时间,单位毫秒 |
| uuid | String | 考试唯一ID,最大长度36字符 |
| title | String | 考试标题,最大长度255字符 |
| category_id | String | 考试分类ID,最大长度36字符 |
| certificate_id | String | 关联证书ID,最大长度36字符 |
| type | String | 考试类型: normal 正式考试 exercise 练习考试 share 分享考试 |
| status | Int | 考试状态: -1 删除 0 未发布 1 已发布 2 关闭 |
| total_score | Decimal(8,1) | 卷面总分 |
| pass_score | Decimal(8,1) | 通过总分 |
| max_duration | Int | 考试时长,单位秒,最大位数10 |
| start_time | Int | 考试开始时间,Unix时间戳,单位毫秒 |
| end_time | Int | 考试结束时间,Unix时间戳,单位毫秒 |
| user_num | Int | 考生总人数,最大位数10 |
| create_time | Int | 创建时间,Unix时间戳,单位毫秒 |
| update_time | Int | 更新时间,Unix时间戳,单位毫秒,如果status为-1或者2,此为最后操作时间 |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "exam_create",
"event_time": 1609957197000,
"uuid": "2A09EBF2-A8D9-4BDF-8D60-FADE743E1777",
"title": "考试标题2",
"category_id": "1C09EBF2-A8D9-4BDF-8D60-FADE743E1508",
"certificate_id": "200619E7-5004-464D-A80A-D9D2DFA4F272",
"type":"normal",
"status": 1,
"total_score": 50,
"pass_score": 15,
"max_duration": 120,
"start_time": 1546565453000,
"end_time": 1609957197000,
"user_num": 100,
"create_time": 1609957197000,
"update_time": 1609957197000
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 course-learn_start 课程开始学习 course-learn_end 课程完成学习 |
| event_time | Int | 事件触发时间,单位毫秒 |
| course_id | String | 课程ID,最大长度36字符 |
| dept_user_id | String | 用户UserID |
| ip | String | 学员客户端IP |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "course-learn_end",
"event_time": 1609957197000,
"course_id": "472E80BE-7700-4399-91B6-7415C97A0E52",
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"ip": "119.166.167.236",
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 learningmap-learn_start 学习地图开始学习 learningmap-learn_end 学习地图完成学习 |
| event_time | Int | 事件触发时间,单位毫秒 |
| learningmap_id | String | 学习地图ID,最大长度36字符 |
| dept_user_id | String | 用户UserID |
| ip | String | 学员客户端IP |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "learningmap-learn_end",
"event_time": 1609957197000,
"learningmap_id": "472E80BE-7700-4399-91B6-7415C97A0E52",
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"ip": "119.166.167.236",
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 training-learn_start 线下培训签到 training-learn_end 完成线下培训 |
| event_time | Int | 事件触发时间,单位毫秒 |
| training_id | String | 线下培训ID,最大长度36字符 |
| dept_user_id | String | 用户UserID |
| ip | String | 学员客户端IP |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "training-learn_end",
"event_time": 1609957197000,
"training_id": "472E80BE-7700-4399-91B6-7415C97A0E52",
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"ip": "119.166.167.236",
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 exam-learn_start 参与考试开始 exam-learn_end 参与考试结束 |
| event_time | Int | 事件触发时间,单位毫秒 |
| exam_id | String | 考试ID,最大长度36字符 |
| dept_user_id | String | 用户UserID |
| ip | String | 学员客户端IP |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "exam-learn_end",
"event_time": 1609957197000,
"exam_id": "472E80BE-7700-4399-91B6-7415C97A0E52",
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"ip": "119.166.167.236",
}
| 参数 | 类型 | 说明 |
|---|---|---|
| company_id | String | 事件所属组织ID |
| event_action | String | 事件类型标识 train_learn_time 完成课时数更新 train_certificate 证书数量更新 train_credit_scores 学分更新 train_study_completions 完成培训数更新(课程、线下培训) train_learning_map_end 学习地图完成 train_learning_map_assign 学习地图指派 train_learning_map_unassign 学习地图移除指派 train_learning_map_publish 学习地图发布 train_learning_map_close 学习地图关闭 |
| event_time | Int | 事件触发时间,单位毫秒 |
| dept_user_id | String | 用户UserID |
| user_training_data | Array | 学员培训汇总数据 |
| total_learn_seconds | Int | 总学习时长,单位秒 |
| total_certificates | Int | 获得证书数量 |
| total_credit_scores | Decimal(12,1) | 获得总学分 |
| total_study_completions | Int | 完成培训数(课程) |
| new_employee_train | Array | 仅钉钉智能人事用,其它伙伴请忽略 |
| train_id | String | 培训汇总全局唯一ID |
| company_id | String | 冗余事件所属组织ID |
| event_action | String | 冗余事件类型标识 |
| dept_user_id | String | 冗余用户UserID |
解密后消息体样例:
{
"company_id": "dingc4cffb655c00d67f35c2f4657eb6378f",
"event_action": "train_learning_map_end",
"event_time": 1609957197000,
"dept_user_id": "3ed36666-5994-4e4b-8c5d-df7aa3686b2d",
"user_training_data": {
"total_learn_seconds":"945583",
"total_certificates":"0",
"total_credit_scores":"0.0",
"total_study_completions":"4287",
"new_employee_train":[],
"train_id":"7d48496f56e2911e0d49e986256b0e48",
"company_id":"ding7931e374f3bd11c624f2f5cc6abecb85",
"event_action":"train_learning_map_end",
"dept_user_id":"3ed36666-5994-4e4b-8c5d-df7aa3686b2d"
}
}