服务端API



获取考试分类列表

请求方式:GET(HTTPS)
请求地址:https://oapi.soke.cn/exam/category/list
Query参数说明:

参数 类型 必须 说明
access_token String 是 应用access_token,2小时有效期
page Int 否 页码,默认从1开始
page_size Int 否 每页条数,最大100,默认100

返回结果:

{
    "code": "200",
    "status": "ok",
    "message": "success",
    "data": {
        "list": [
            {
                "uuid"  : "分类唯一ID1",
                "title" : "分类标题1",
                "parent_id": "1C09EBF2-A8D9-4BDF-8D60-FADE743E1501",
                "create_time": 1546565453000,
            },
          	{
                "uuid"  : "分类唯一ID2",
                "title" : "分类标题2",
                "parent_id": "2C09EBF2-A8D9-4BDF-8D60-FADE743E1502",
                "create_time": 1546565453000,
            }
        ],
        "has_more": 1
    }
}

参数说明:

参数 类型 说明
data Array 返回的数据包
list Array 返回的分类列表
uuid String 分类唯一ID,最大长度36字符
title String 分类标题,最大长度64字符
parent_id String 分类父ID,最大长度36字符
create_time String 创建时间,Unix时间戳,单位毫秒
has_more Int 是否还有数据没返回:
1 还有
0 没有



获取考试列表

请求方式:GET(HTTPS)
请求地址:https://oapi.soke.cn/exam/exam/list
Query参数说明:

参数 类型 必须 说明
access_token String 是 应用access_token,2小时有效期
start_time Int 是 考试创建时间的查询起始时间,Unix时间戳,单位毫秒
end_time Int 是 考试创建时间的查询结束时间,Unix时间戳,单位毫秒
注意:起始与结束时间差不超365天
status Int 否 考试状态:
0 未发布
1 已发布
2 已关闭
page Int 否 页码,默认从1开始
page_size Int 否 每页条数,最大100,默认100

返回结果:

{
    "code": "200",
    "status": "ok",
    "message": "success",
    "data": {
        "list": [
            {
                "uuid": "1A09EBF2-A8D9-4BDF-8D60-FADE743E1666",
                "title": "考试标题1",
                "category_id": "1C09EBF2-A8D9-4BDF-8D60-FADE743E1508",
                "certificate_id": "100619E7-5004-464D-A80A-D9D2DFA4F271",
                "type":"normal",
                "status": 1,
                "total_score": 50,
                "pass_score": 15,
                "max_duration": 120,
                "start_time": 1546565453000,
                "end_time": 1609957197000,
                "user_num": 100,  
                "create_time": 1546565453000,
                "create_dept_user_id": "180765263821",
            },
          	{
                "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": 1546565453000,
                "create_dept_user_id": "180765263821",
            }
        ],
        "has_more": 1
    }
}

参数说明:

参数 类型 说明
data Array 返回的数据包
list Array 返回的用户列表
uuid String 考试唯一ID,最大长度36字符
title String 考试标题,最大长度255字符
category_id String 分类ID,最大长度36字符
certificate_id String 关联证书ID,最大长度36字符
type String 考试类型:
normal 正式考试
exercise 练习考试
share 分享考试
status Int 考试状态:
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时间戳,单位毫秒
create_dept_user_id String 创建考试人员钉钉内userid
has_more Int 是否还有数据没返回:
1 还有
0 没有



获取考试学员考试结果列表

请求方式:GET(HTTPS)
请求地址:https://oapi.soke.cn/exam/user/list
Query参数说明:

参数 类型 必须 说明
access_token String 是 应用access_token,2小时有效期
exam_id String 是 考试ID,最大长度36字符
userid_list String 否 员工在企业内的UserID列表,多个UserId用英文逗号隔开,一次最多100个
start_time Int 否 考试成绩更新时间的查询起始时间,Unix时间戳,单位毫秒
注意:开始时间与当前时间差不能大于365天
end_time Int 否 考试成绩更新时间的查询结束时间,Unix时间戳,单位毫秒
注意:起始与结束时间差不超7天
page Int 否 页码,默认从1开始
page_size Int 否 每页条数,默认100,最大100

Query参数提示: userid_list参数与start_time、end_time时间参数二选一,不能同时不传。

返回结果:

{
    "code": "200",
    "status": "ok",
    "message": "success",
    "data": {
        "list": [ 
          {
                "dept_user_id"  : "11121033-3F87-48E3-B1B7-EBEF3339B8C1",
                "pass_status": "passed",
                "attempt_times":2,
                "last_score": 5,
                "avg_score": 5,
                "status": 1,
                "point": 0,
                "credit": 0,
                "passed_time": 1609957197000,
                "update_time": 1609957197000,
                "create_time": 1546565453000
            },
          	{
                "dept_user_id"  : "21121033-3F87-48E3-B1B7-EBEF3339B8C2",
                "pass_status": "passed",
                "attempt_times":2,
                "last_score": 5,
                "avg_score": 5,
                "status": 1,
                "point": 0,
                "credit": 0,
                "passed_time": 0,
                "update_time": 1609957197000,
                "create_time": 1546565453000
            }
        ],
        "has_more": 1
    }
}

参数说明:

参数 类型 说明
data Array 返回的数据包
list Array 返回的用户列表
dept_user_id String 用户ID,最大长度64字符
pass_status String 考试状态:
not_attempt 未考试
reviewing 阅卷中
passed 通过
unpassed 未通过
attempt_times Int 参加考试的次数,最大位数8
last_score Decimal(8,1) 最后一次考试成绩
avg_score Decimal(8,1) 平均考试成绩
status Int 指派用户状态:
1 指派中
-1 已移除指派
point Float 获得积分
credit Flost 获得学分
passed_time Int 最后一次通过时间,Unix时间戳,单位毫秒,未通过值为0
create_time Int 指派或加入时间,Unix时间戳,单位毫秒
update_time Int 最后更新时间,Unix时间戳,单位毫秒
has_more Int 是否还有数据没返回:
1 还有
0 没有



获取考试学员详情

请求方式:GET(HTTPS)
请求地址:https://oapi.soke.cn/exam/user/info
Query参数说明:

参数 类型 必须 说明
access_token String 是 应用access_token,2小时有效期
exam_id String 是 考试ID
dept_user_id String 是 员工在企业内的UserID

返回结果:

{
  "code": "200",
  "status": "ok",
  "message": "获取详情成功",
  "data": {
      "target_id" : "F52FAEAB-5C9F-4A4B-A183-6E04835063A8",
      "target_title" : "考试名称",
      "category_id" : "95DD4D72-E504-4550-81A2-F48EFEEB8FC2",
      "category_title" : "通用考试", 
      "dept_user_id"  : "12345678",
      "total_score" : 100,
      "pass_score" : 100,
      "pass_status": "passed",
      "attempt_times":2,
      "last_score": 5,
      "status": 1,
      "avg_used_time": 128,
      "point": 12.25,
      "credit": 8.10,
      "passed_time": "1609957197000",
      "create_time": "1509957197000"
  }
}

参数说明:

参数 类型 说明
data Array 返回的数据包
target_id String 来源ID,最大长度36字符
target_title String 来源名称,最大长度255
category_id String 分类ID,最大长度36字符
category_title String 分类标题,最大长度255
dept_user_id String 用户ID,最大长度64字符
total_score Decimal(8,1) 考试总分
pass_score Decimal(8,1) 考试及格分数
pass_status String 考试状态:
not_attempt 未考试
reviewing 阅卷中
passed 通过
unpassed 未通过
attempt_times Int 参加考试的次数,最大位数8
last_score Decimal(8,1) 最后一次考试成绩
status Int 指派用户状态:
1 指派中
-1 已移除指派
avg_used_time Int 平均用时,单位秒
point Decimal(12,2) 获得积分
credit Decimal(12,2) 获得学分
passed_time Int 最后一次通过时间,Unix时间戳,单位毫秒,未通过值为0
create_time Int 指派或加入时间,Unix时间戳,单位毫秒



获取考试结果列表

请求方式:GET(HTTPS)
请求地址:https://oapi.soke.cn/exam/result/list
Query参数说明:

参数 类型 必须 说明
access_token String 是 应用access_token,2小时有效期
exam_id String 是 考试ID,最大长度36字符
userid_list String 否 员工在企业内的UserID列表,多个UserId用英文逗号隔开
page Int 否 页码,默认从1开始
page_size Int 否 每页条数,默认100,最大100

返回结果:

{
    "code": "200",
    "status": "ok",
    "message": "success",
    "data": {
        "list": [ 
            {
                "result_id": "F52FAEAB-5C9F-4A4B-A183-6E04835063A8",
                "name": "张三",
                "job_number": "123456",
                "dept_names": "企业-部门-车检",
                "exam_name": "生产信息化考试",
                "end_time": 1781523472000,
                "passed_time": 1781523472000,
                "score": "92.0",
                "used_time": 389,
                "status": "finished",
                "passed_status": "passed",
                "dept_user_id": "6E04835063A8"
            },
            {
                "result_id": "F52FAEAB-5C9F-4A4B-A183-6E04835063A9",
                "name": "李四",
                "job_number": "234567",
                "dept_names": "企业-部门-质检",
                "exam_name": "生产信息化考试",
                "end_time": 0,
                "passed_time": 0,
                "score": "10.0",
                "used_time": 332,
                "status": "finished",
                "passed_status": "unpassed",
                "dept_user_id": "6E04835063A9"
            }
        ],
        "has_more": 1
    }
}

参数说明:

参数 类型 说明
data Array 返回的数据包
list Array 返回的用户列表
dept_user_id String 用户ID,最大长度64字符
name String 用户姓名
job_number String 用户工号
dept_names String 用户部门
exam_name String 考试名称
result_id String 考试结果唯一id
pass_status String 考试状态:
not_attempt 未考试
reviewing 阅卷中
passed 通过
unpassed 未通过
score Decimal(8,1) 考试成绩
end_time Int 交卷时间,Unix时间戳,单位毫秒,未交卷值为0
passed_time Int 通过时间,Unix时间戳,单位毫秒,未通过值为0
used_time Int 考试用时,单位秒,未考试0
has_more Int 是否还有数据没返回:
1 还有
0 没有