微哨开放平台开发者文档(API V2.2)

优质
小牛编辑
137浏览
2023-12-01

基础接口

【获取access_token】

基本描述

Access Token是开发者的全局唯一票据,开发者调用各接口时都需使用Access Token。Access Token的有效期目前为2周,需定时刷新,重复获取将导致上次获取的Access Token失效。

注意:此处获取的Access Token是Client Credentials模式的Access Token,请勿和第三方应用接入(即Authorization Code模式)所获取的Access Token混用。

请求方式

POST

请求url形式

https://api.weishao.com.cn/oauth/token

参数说明

参数名必填类型说明
grant_typetruestring设置为固定值”client_credentials”
app_keytruestring接入应用的app_key,在管理端或开放平台中应用创建时获得
app_secrettruestring接入应用的app_secret,在管理端或开放平台中应用创建时获得
scopetruestring开放平台创建的应用为”base_api”,学校管理端创建的应用为”all”

json数据示例:

{
        "grant_type":"client_credentials",
        "app_key": [app_key],
        "app_secret":[app_secret],
        "scope":[scope]
}

注意:post数据时,在请求的header里面增加Content-Type:application/json

返回结果

正确返回 json示例

{
"access_token": "VrwNIk9VGqrucb6zZukmCuQbvlBhbnwj",//string类型,票据内容
"expires_in": 1209600,//过期时间(秒)
"scope": "base_api",
"refresh_token": "sOEnnK5fgJBmIXNuONndIvYCbmP7Af2s",//刷新token的依据
"token_type": "Bearer"
}

错误返回 json示例

app_secret取值错误的响应码

HTTP Status Code 401

scope取值异常的错误码

HTTP Status Code 403

{
"error": "access_denied",
"error_description": "Unauthorized scope: manaer" 
}

grant_type取值异常的错误码

HTTP Status Code 400

{
"error": "unsupported_grant_type", 
"error_description": "Unsupported grant type: client_edentials" 
}

返回结果字段说明

参数名类型说明
access_tokenstring请求令牌内容
expires_instring过期时间(秒)
scopestringScope
refresh_tokenstring刷新token的依据
token_typestringBearer

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:base_api或all

注意事项

所有的开放平台接口在访问时都需要access_token。微哨服务器会首先验证access_token合法性,才会进行之后的逻辑。如果验证失败则返回的http状态码为401或403

access_token取值异常的错误码

HTTP Status Code 403

{
    "error": "invalid_grant", 
    "error_description": "Access token is expired" 
}

【刷新access_token】

基本描述

所有的开放平台接口在访问时都需要access_token。微哨服务器会首先验证access_token合法性,才会进行之后的逻辑。access_token具有时效性,过期后需要开发者手动刷新access_token.

请求方式

POST

请求url形式

https://api.weishao.com.cn/oauth/token

参数说明

参数名必填类型说明
grant_typetruestring设置为固定值”refresh_token”
app_keytruestring接入应用的app_key,在管理端或开放平台中应用创建时获得
app_secrettruestring接入应用的app_secret,在管理端或开放平台中应用创建时获得
refresh_tokentruestring上次获取token中反馈的refresh_token

请求json数据示例:

     {
        "grant_type": "refresh_token",
        "app_key": [app_key],
        "app_secret": [app_secret],
        "refresh_token": "***********"
     }

注意:post数据时,在请求的header里面增加Content-Type:application/json

返回结果

成功返回json示例

{
    "access_token": "xN2836yQAQfDURxVPds0IM9vfUk3IJC5",
    "expires_in": 604800,
    "scope": "base_api",
    "refresh_token": "VFlAp82EUWNQJkokRvoELSPhPpO3pSPS",
    "token_type": "Bearer"
}

错误返回json示例

refresh_token取值异常的错误码

HTTP Status Code 403

{
    "error": "invalid_grant", 
    "error_description": "Invalid refresh token"
}

返回结果字段说明

参数名类型说明
access_tokenstring请求令牌内容
expires_instring过期时间(秒)
scopestringScope
refresh_tokenstring刷新token的依据
token_typestringBearer

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:base_api或all

注意事项

用户接口

【验证用户身份】

基本描述

当用户通过微哨客户端启动并访问第三方应用时,第三方服务器可使用该api验证该用户并获取该用户的基本信息.

请求方式

GET或POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/user/authUser?verify=[verify]&access_token=[access_token]

参数说明

参数名必填类型说明
verifytruestring访问令牌,微哨客户端通过http请求访问应用时会携带该参数,应用服务器可以通过”verify”关键字从http请求中获取
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
  "ret": 0,
  "errcode": 1000,
  "errmsg": "ok",
  "data": {
    "domain": "whistle",//学校域名
    "name": "张三",//姓名
    "sex": "boy",//性别,”boy”表示男,”girl”表示女
    "student_number": "666",//学工号
    "path": "1,5740",//所在组织路径
    "photo_live": "http://172.16.56.175/group1/M00/01/75/rBA4r1ZJqNWIOxFFAABFfDg7GJIAAAAEhCAuUQAAEWU193.png",//头像存放的url地址
    "mood_words": "签名",//用户签名
    "nick_name": "昵称",//昵称
    "identity": "student",//身份,”teacher”表示老师,”student”表示学生
    "uid": "94279",//用户id (发送消息时,消息的接收者使用该字段)
    "id_type": "1",//证件类型,1表示证件号,2表示护照,3表示军官证,4表示学工号
    "id_number": "110101199010112056",//证件号
    "stu_school_area": "",//学生所在宿舍区
    "pycc": "0",//培养层次,0表示本科,1表示硕士研究生,2表示博士研究生,3表示专科,-1表示其他
    "cellphone": "",//手机号(长号)
    "phone_cornet": "",//手机短号
    "landline": "",//固定电话
    "landline_cornet": "",//固定电话短号
    "email": "",//邮箱地址
    "school_year": "2018",//入学年份
    "sznj": "2018",//所在年级
    "zzmm": "01",//政治面貌(新),01表示中共党员,02表示中共预备党员,03表示共青团员,04表示民革会员,05表示民盟盟员,06表示民建会员,07表示民进会员,08表示农工党党员,09表示致公党党员,10表示九三学社社员,11表示台盟盟员,12表示无党派民主人士,13表示群众
    "labels": [
      {
        "id": "id",//标签id
        "label_name": "label_name"//标签名称
      },...
    ],//用户所属标签,可能有多个
    "org": [
      {
        "path": "1,5740",//所在组织路径
        "organization_id": "5740",//用户所在组织节点id
        "organization": "行政组织架构&0/微哨事业部&1"//用户所在各级组织结构名称及组织属性,1表示院系,2表示班级,3表示行政单位, 4表示专业,0表示其他
      }
    ],
    "organization_id": "5740",//用户所在组织节点id
    "organization": "行政组织架构&0/微哨事业部&1",//用户所在各级组织结构名称及组织属性,1表示院系,2表示班级,3表示行政单位, 4表示专业,0表示其他
    "organization_name": "行政组织架构/微哨事业部",//用户所在各级组织结构名称
    "adhoc": [
      {
        "adhoc_id": "adhoc_id",//非常设机构id
        "name": "name"//非常设机构名称
      },...
    ],//用户所属非常设机构,可能有多个
    "job": [
      {
        "id": "id",//职务id
        "post_name": "post_name"//职务名称
      },...
    ],//用户所属职务,可能有多个
    "qq_openid": "",//QQ校园的openid
    "qy_openid": "",//企业号的openid
    "qy_userid": "",//企业号的userid
    "wx_openid": ""//微信服务号的openid
  }
}

返回结果字段说明

参数名类型说明
namestring姓名
sexstring性别,”boy”表男,”girl”表示女
photo_livestring头像图片的url地址
mood_wordsstring用户签名
student_numberstring学工号
nick_namestring昵称
organizationstring用户所在各级组织结构名称
organization_idstring用户所在组织节点id
uidstring用户id (发送消息时,消息的接收者使用该字段)
identitystring身份,”teacher”表示老师,”student”表示学生
domainstring学校域名
labelsarray用户所属标签,可能有多个
adhocarray用户所属非常设机构,可能有多个
jobarray用户所属职务,可能有多个

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:base_api或all

注意事项

【获取用户信息】

基本描述

第三方应用服务器通过本方法可以查询给定学工号对应的用户基本信息.

请求方式

GET或POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/user/getInfo?student_number=[student_number]&access_token=[access_token]

参数说明

参数名必填类型说明
student_numbertruestring学工号
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
  "ret": 0,
  "errcode": 1000,
  "errmsg": "ok",
  "data": {
    "domain": "whistle",//学校域名
    "name": "张三",//姓名
    "sex": "boy",//性别,”boy”表示男,”girl”表示女
    "student_number": "666",//学工号
    "path": "1,5740",//所在组织路径
    "photo_live": "http://172.16.56.175/group1/M00/01/75/rBA4r1ZJqNWIOxFFAABFfDg7GJIAAAAEhCAuUQAAEWU193.png",//头像存放的url地址
    "mood_words": "签名",//用户签名
    "nick_name": "昵称",//昵称
    "identity": "student",//身份,”teacher”表示老师,”student”表示学生
    "uid": "94279",//用户id (发送消息时,消息的接收者使用该字段)
    "id_type": "1",//证件类型,1表示证件号,2表示护照,3表示军官证,4表示学工号
    "id_number": "110101199010112056",//证件号
    "stu_school_area": "",//学生所在宿舍区
    "pycc": "0",//培养层次,0表示本科,1表示硕士研究生,2表示博士研究生,3表示专科,-1表示其他
    "cellphone": "",//手机号(长号)
    "phone_cornet": "",//手机短号
    "landline": "",//固定电话
    "landline_cornet": "",//固定电话短号
    "email": "",//邮箱地址
    "school_year": "2018",//入学年份
    "sznj": "2018",//所在年级
    "zzmm": "01",//政治面貌(新),01表示中共党员,02表示中共预备党员,03表示共青团员,04表示民革会员,05表示民盟盟员,06表示民建会员,07表示民进会员,08表示农工党党员,09表示致公党党员,10表示九三学社社员,11表示台盟盟员,12表示无党派民主人士,13表示群众
    "labels": [
      {
        "id": "id",//标签id
        "label_name": "label_name"//标签名称
      },...
    ],//用户所属标签,可能有多个
    "org": [
      {
        "path": "1,5740",//所在组织路径
        "organization_id": "5740",//用户所在组织节点id
        "organization": "行政组织架构&0/微哨事业部&1"//用户所在各级组织结构名称及组织属性,1表示院系,2表示班级,3表示行政单位, 4表示专业,0表示其他
      }
    ],
    "organization_id": "5740",//用户所在组织节点id
    "organization": "行政组织架构&0/微哨事业部&1",//用户所在各级组织结构名称及组织属性,1表示院系,2表示班级,3表示行政单位, 4表示专业,0表示其他
    "organization_name": "行政组织架构/微哨事业部",//用户所在各级组织结构名称
    "adhoc": [
      {
        "adhoc_id": "adhoc_id",//非常设机构id
        "name": "name"//非常设机构名称
      },...
    ],//用户所属非常设机构,可能有多个
    "job": [
      {
        "id": "id",//职务id
        "post_name": "post_name"//职务名称
      },...
    ],//用户所属职务,可能有多个
    "qq_openid": "",//QQ校园的openid
    "qy_openid": "",//企业号的openid
    "qy_userid": "",//企业号的userid
    "wx_openid": ""//微信服务号的openid
  }
}

返回结果字段说明

参数名类型说明
namestring姓名
sexstring性别,”boy”表男,”girl”表示女
photo_livestring头像图片的url地址
mood_wordsstring用户签名
student_numberstring学工号
nick_namestring昵称
organizationstring用户所在各级组织结构名称
organization_idstring用户所在组织节点id
uidstring用户id (发送消息时,消息的接收者使用该字段)
identitystring身份,”teacher”表示老师,”student”表示学生
domainstring学校域名
labelsarray用户所属标签,可能有多个
adhocarray用户所属非常设机构,可能有多个
jobarray用户所属职务,可能有多个

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:base_api或all

注意事项

用户搜索接口

基本描述

第三方应用服务器通过本方法可以查询给定学工号对应的用户基本信息.

请求方式

GET或POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/user/searchGlobalUserList?name=[name]&status=1&access_token=[access_token]

参数说明

参数名必填类型说明
nametruestring用户姓名或者拼音 或者学号
statustruestring用户状态,取值为0 或1
search_flagtruestring默认为all表示搜索姓名 拼音和学号,取其他值则只搜索姓名
pagetruestring页码
counttruestring单页数量
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    “ret”:0
    "errcode":1000,
    "errmsg": "ok",
    "data": [
        {
            "identity": "student",
            "name": "\u9093\u4fca",
            "pinyin": ".dj.dengjun.",
            "sex": "girl",
            "status": "1",
            "student_number": "0304150123",
            "username": "11094",
            "photo_live": "",
            "path": "1,45,46,58,59",
            "zzmm": "",
            "path_name": "\u5fae\u54e8\u6e29\u5927,\u7ecf\u6d4e\u7ba1\u7406\u5b66\u9662,2015\u7ea7,\u65c5\u6e38\u7ba1\u7406,\u65c5\u6e381501"
        },
        {
            "identity": "student",
            "name": "\u6f58\u96ea\u6885",
            "pinyin": ".pxm.panxuemei.",
            "sex": "girl",
            "status": "1",
            "student_number": "0306150123",
            "username": "10993",
            "photo_live": "",
            "path": "1,45,46,53,54",
            "zzmm": "",
            "path_name": "\u5fae\u54e8\u6e29\u5927,\u7ecf\u6d4e\u7ba1\u7406\u5b66\u9662,2015\u7ea7,\u9152\u5e97\u7ba1\u7406,\u9152\u5e971501"
        }
    ]
}

返回结果字段说明

参数名类型说明
namestring姓名
sexstring性别,”boy”表男,”girl”表示女
photo_livestring头像图片的url地址
student_numberstring学工号
pathstring用户所在各级组织结构路径
path_namestring用户所在各级组织结构路径名称
usernamestring用户id
identitystring身份,”teacher”表示老师,”student”表示学生
zzmmstring政治面貌
pinyinstring用户姓名拼音
statusint取值0或者1,0为禁用

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

通知接口

【获取已发送通知列表】

基本描述

第三方应用服务器通过本方法可以查询本应用已经发送过的通知记录.

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/notification/getList?access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok",
    "data": {
        "notification_list": [//array,通知历史记录数组
            "xxxx123",//string,通知id
            "xxxx124",
            "xxxx125"
        ]
    }

}

返回结果字段说明

参数名类型说明
notification_listarray通知历史记录数组

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【获取通知详情】

基本描述

第三方应用服务器通过本方法可以查询指定通知记录的详情.

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/notification/getDetails?notification_id=[notification_id]&access_token=[access_token]

参数说明

参数名必填类型说明
notification_idtruestring通知的id
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok",
    "data": {
        “type”:”unicast/broadcast”,//string,通知类型,"unicast"表示点播(发送给单个微哨订阅用户),"broadcast"表示广播(发送给应用的所有微哨订阅用户)
        "sendList": {//object,描述接收者,只有type="unicast"才需要本字段
            "user":"xxx001"//string,接收者id
        },
        "schedule": {//object,描述发送时间的配置
            "type": "instant\delayed ",//string,配置类型,"instant"表示立即发送,"delayed"表示延迟发送
            "delayed_datetime": "2015-05-06 11:00:00"//date,如果是type=="delayed",本字段指定发送的时间
        },
        “content”:{
            "message": ["asdfsdafasfadsf"], //array,普通文本内容, 数组元素为string类型,只有一个元素
            "rich_message":["<style type=\"text/css\">div{max-width:100%;word-break:break-all;font-size: 50px} img{max-width:100%;height:auto;display:block;}</style><div><strong><span style=\"text-decoration: underline;\">ddddd</span></strong></div>"], // array, 富文本内容
            "msgType":1   // int, 发送的内容是否以富文本形式展示的标识
        },
        “title”:”消息标题”//string,消息的标题
   }

}

返回结果字段说明

参数名类型说明
typestring通知类型,”unicast”表示点播(发送给单个微哨订阅用户),”broadcast”表示广播(发送给应用的所有微哨订阅用户)
sendListobject描述接收者,只有type=”unicast”才需要本字段
scheduleobject描述发送时间的配置
contentstring消息的内容
titlestring消息的标题
userstring接收者id
typestring配置类型,”instant”表示立即发送,”delayed”表示延迟发送
delayed_datetimedate如果是type==”delayed”,本字段指定发送的时间
messagearray普通文本内容, 数组元素为string类型,只有一个元素
rich_messagearray富文本内容, 数组元素为string类型,只有一个元素
msgTypeint展示富文本还是普通文本的标识,值为1以富文本展示,不传值或值为其它则以普通文本展示

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【发送通知】

基本描述

第三方应用服务器通过本方法可以发送通知.

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/notification/sendNotification?access_token=[access_token]

请求结构体

通知json数据对象示例:

{
        "type":"unicast/broadcast/listcast",//string,通知类型,"unicast"表示点播(发送给单个微哨订阅用户),"broadcast"表示广播(发送给应用的所有微哨订阅用户)
        "sendList": {//object,描述接收者,只有type="unicast/listcast"才需要本字段
            "user":"xxx001"//string,接收者id,当type为unicast是设置该参数
            "student_number":"xxx001"//string,接收者学号,当type为unicast是设置该参数
            "users":"xxx001"//array,接收者id,当type为listcast是设置该参数
            "student_numbers":"xxx001"//array,接收者学号,当type为listcast是设置该参数
        },
        "schedule": {//object,描述发送时间的配置
            "type": "instant\delayed ",//string,配置类型,"instant"表示立即发送,"delayed"表示延迟发送
            "delayedDatetime": "2015-05-06 11:00:00"//date,如果是type=="delayed",本字段指定发送的时间
        },
        "content":{
            "message": ["asdfsdafasfadsf"],  //array, 普通文本内容, 数组元素为string类型,只有一个元素
            "rich_message":["%3cstyle+type%3d%5c%22text%2fcss%5c%22%3ediv%7bmax-width%3a100%25%3bword-break%3abreak-all%3bfont-size%3a+50px%7d+img%7bmax-width%3a100%25%3bheight%3aauto%3bdisplay%3ablock%3b%7d%3c%2fstyle%3e%3cdiv%3e%3cstrong%3e%3cspan+style%3d%5c%22text-decoration%3a+underline%3b%5c%22%3eddddd%3c%2fspan%3e%3c%2fstrong%3e%3c%2fdiv%3e"], // array, 富文本内容 需要进行urlencode编码
            "msgType":1   // int, 展示富文本还是普通文本的标识
        },
        "title":"消息标题", //string,消息的标题
        "sms": { // 短信补发相关参数
            "interval": 60 //单位分钟,大于0的正整数,表示60分钟后,发送短信给未阅读通知的用户
        }
}

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
typetrue“unicast/broadcast/listcast”通知类型,”unicast”表示点播(发送给单个微哨订阅用户),”broadcast”表示广播(发送给应用的所有微哨订阅用户),”listcast”表示列播(发送给一批订阅用户,数量小于500)
sendListtrueobject描述接收者,当type=”unicast/listcast”设置本字段
usertruestring接收者id
student_numbertruestring接收者学号,与user字段二选一
userstruearray接收者id ,当type为listcast是设置该参数,数组size<=500
student_numberstruearray接收者学号,,当type为listcast是设置该参数,数组size<=500,与users字段二选一
scheduletrueobject描述发送时间的配置
schedule/typetrue“instant\delayed “配置类型,”instant”表示立即发送,”delayed”表示延迟发送
delayedDatetimetruedate如果是type==”delayed”,本字段指定发送的时间
contenttrueobject消息的内容
messagetruearray普通文本内容, 数组元素为string类型,只有一个元素
rich_messagetruearray富文本内容, 数组元素为string类型,只有一个元素 内容需要进行urlencode编码
msgTypefalseint展示富文本还是普通文本的标识,值为1以富文本展示,不传值或值为其它则以普通文本展示,富文本目前支持 加粗、下划线、字体颜色、左对齐、居中、右对齐、两端对齐、表格、图片、链接
titletruestring消息的标题
smsfalseobject短信补发相关参数
intervaltrueint短信补发时必填。表示短信下发时间间隔,单位分钟,大于0的正整数

返回结果

json示例

{
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok",
    "data": {
        "notification_id": "xxxxx123", //string,通知id
        "not_exist_users": ["21212","02sa"], //不存在的用户id
        "sms": { // 当设置短信补发时返回
            "status": 1000,
            "msg": "短信补发设置成功"
        }
    }

} 

返回结果字段说明

参数名类型说明
notification_idstring通知id
not_exist_usersarray不存在的用户id列表
smsobject短信补发结果
statusint短信补发状态码
smsobject短信补发状态消息

其中,短信补发状态码说明如下:

status说明
1000短信补发设置成功
1001发送时间只能为数字
1002发送时间必须大于0
1003该应用未开启短信补发功能
1004该学校未开启短信补发功能

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

type为listcast 时 如果users/student_numbers中所有推送用户均未订阅该应用,则返回1005错误。存在部分未订阅用户时不返回错误信息,正常推送在订阅范围内的用户。

【发送消息】

基本描述

第三方开发者通过本接口发送消息给用户,支持通知、短信等任意一种或多种方式组合发送通知。本接口是sendNotification接口的升级,原接口可正常使用。

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/notification/sendMessage?access_token=[access_token]

请求结构体

消息json数据对象示例:

{
        "type":"unicast/broadcast/listcast",//string,通知类型,"unicast"表示单播(发送给单个微哨订阅用户),"broadcast"表示广播(发送给应用的所有微哨订阅用户),"listcast"表示列播(发送给sendList参数中的用户)
        "sendList": {//json,描述接收者,只有type="unicast/listcast"才需要本字段
            "user":"xxx001",//string,接收者id
            "student_number":"xxx001",//string,接收者学号参数
            "users":["xxx001","xxx002"],//array,接收者id
            "student_numbers":["xxx001","xxx002"]//array,接收者学号
        },
        "schedule": {//json,描述发送时间的配置
            "type": "instant/delayed ",//string,"instant"表示立即发送,"delayed"表示延迟发送
            "delayedDatetime": "2019-05-22 11:00:00"//string,延迟发送时需要指定发送时间
        },
        "content":{
            "message": ["content"],//array(仅支持1个元素),普通文本内容,数组元素为string类型
            "rich_message":["%3chtml%3e%3cp%3e%e5%af%8c%e6%96%87%e6%9c%ac%e5%86%85%e5%ae%b9%3c%2fp%3e%3c%2fhtml%3e"],//array(仅支持1个元素), 富文本内容 需要进行urlencode编码
            "msgType":1   // int, 1 展示富文本 0 普通文本的标识
        },
        "title":"消息标题",//string,消息的标题
        "sms": { // 短信补发相关参数
            "interval": 60 //单位分钟,大于0的正整数,表示60分钟后,发送短信给未阅读通知的用户
        },
        "platform": { // 消息发送方式,必填项
            "app": {        
                "third": [] // 如果采用通知方式,需要设置该字段,为空数组即可
            },
            "sms":{
                "content":"短信内容"  // string, 如果采用短信方式,需要设置该字段
            }
        },
}
参数说明
参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
typetruestring通知类型,支持以下3种:
unicast:单播(发送给单个微哨订阅用户);
broadcast:广播(发送给应用的所有微哨订阅用户)
listcast:列播(发送给多个微哨订阅用户)
sendListtruejson通知类型为unicast或listcast时,需要通过本字段指定接收人
sendList->userfalsestring接收者id,unicast时,和student_number参数二选一
sendList->student_numberfalsestring接收者学号,unicast时,和user参数二选一
sendList->usersfalsearray多个接收者id
sendList->student_numbersfalsearray多个接收者学号
scheduletruejson发送时间的配置
schedule->typetruestring支持以下2种:
instant:立即发送;
delayed:延迟发送
schedule->delayedDatetimetruestring延迟发送时,必须通过本字段指定发送的时间
contenttruestring消息的内容
content->messagetruearray发送的内容数组,数组每个元素为string类型
content->rich_messagetruearray富文本内容, 数组元素为string类型,只有一个元素 内容需要进行urlencode编码
content->msgTypefalseint1展示富文本,0展示普通文本
titletruestring消息的标题
smsfalsejson短信补发相关参数
sms->intervaltrueint短信补发时必填,表示短信下发时间间隔,单位分钟,大于0的正整数
platformtruejson消息发送方式
platform->appfalsejson以通知形式发送消息
platform->app->thirdtruearray必填,为空数据即可
platform->smsfalsejson以短信形式发送消息
platform->sms->contenttruestring短信内容
返回结果

json示例

{
    "data": {
        "not_exist_users": [
            "1982990028",
            "33333333333333"
        ],
        "notification_id": "186604"
    },
    "errcode": 1000,
    "errmsg": "ok",
    "ret": 0
}
返回结果字段说明
参数名类型说明
notification_idstring消息id
not_exist_usersarray不存于系统的用户id
errcodeint错误码
errmsgstring错误码说明
访问权限限制
  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:base_api
错误码说明

见sendNotification接口的错误码说明。

通讯录接口

【获取组织节点树下的所有用户信息】

基本描述

第三方应用服务器通过本方法可以查询给定组织节点下对应的组织信息和成员构成(但不递归子组织节点).

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/organization/getOrgTree?organization_id=[organization_id]&access_token=[access_token]

参数说明

参数名必填类型说明
organization_idtruestring组织节点id,可通过查询0节点找到学校的根节点信息
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": {
        "org": [{
            "organization_id": 1,//number,子组织节点的id
            "name": "教务处",//string,子节点名称
        },
        {
            "organization_id": 2,
            "name": "学生处",
        }],
        "user": [{//array,指定组织下的用户数组
            "name": "张三",
            "sex": "boy",
            "photo_live": "mtA.jpg",
            "student_number": "STUDENT_NUMBER"
        },
        {
            "name": "李四",
            "sex": "girl",
            "photo_live": "mtB.jpg",
            "student_number": "STUDENT_NUMBER"
        }]
    },
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
organization_idint子组织节点的id
orgarray部门组织数组
userarray指定组织下的用户数组
namestring子节点名称
sexstring性别,”boy”或”girl”
photo_livestring用户的头像
student_numberstring用户的学工号

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

获取学校的标签列表

基本描述

第三方应用服务器通过本方法可以查询学校已创建的标签,与获取用户信息接口配合使用,可以区分不同身份属性的用户。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/label/getList?access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data":[
        {
            "id": 1,//标签id
            "label_name": "学生会"//string,标签名称
        },
        {
            "id": 2,
            "label_name": "2014级"
        }
    ],
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
idint标签id
label_namestring标签名称

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

获取标签下用户列表

基本描述

第三方应用服务器通过本方法可以查询学校某标签下的用户列表。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/label/getUserList?access_token=[access_token]&label_id=[label_id]&offset=[offset]&pagesize=[pagesize]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
label_idtruestring标签id
offsetfalsestring起始位置,为空时从第一条开始取
pagesizefalsestring单次返回结果数量,为空时取至最后一条

返回结果

json示例

{
    "data":{
        "student_numbers":["1234","1235","1236","1237","1238","1239"
        ]
    },
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
student_numbersarray学号数组

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

获取学校的非常设机构列表

基本描述

第三方应用服务器通过本方法可以查询学校已创建的非常设机构,与获取用户信息接口配合使用,可以区分不同身份属性的用户。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/adhoc/getList?access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data":[
        {
            "id": 1,//非常设机构id
            "name": "学生会"//string,非常设机构名称
        },
        {
            "id": 2,
            "name": "军乐团"
        }
    ],
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
idint非常设机构id
namestring非常设机构名称

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

无线定位接口

【获取所有位置的相关信息】

基本描述

第三方应用服务器通过本方法可以获取在定位引擎中配置的所有位置的信息。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/wifiloc/getLocInfo?access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": {
        "buildings": [
            {
                "areaCode": "591",
                "buildingID": "3",
                "buildingName": "宝龙城市广场",
                "floorList": [
                    {
                        "floorid": "7",
                        "floorname": "b1",
                        "poiList": [
                            {
                                "poiid": 714,
                                "name": "楼梯",
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "ret": 0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
areaCodeint区域节点的id
buildingIDint建筑id
buildingNamestring建筑名称
floorListarray楼层信息数组
flooridint楼层id
floornamestring楼层名称
poiidintpoi的id
namestringpoi的名称

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【获取位置节点下当前的用户列表】

基本描述

第三方应用服务器通过本方法可以获取在某些位置节点下目前所有用户的信息。

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/wifiloc/getUserList?access_token=[access_token]

请求结构体

通知json数据对象示例:

{
        poiList: ["1", "2", "3"] //poi的列表
}

参数说明

参数名必填类型说明
poiListtruestring查询位置的poiid。
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": [{
        "poiid":"123",
        "user_count": 243
        "users": [{//array
                "name": "张三",
                "sex": "boy",
                "photo_live": "mtA.jpg",
                "student_number": "STUDENT_NUMBER"
            },
            {
                "name": "李四",
                "sex": "girl",
                "photo_live": "mtB.jpg",
                "student_number": "STUDENT_NUMBER"
            }]
        },
        {
        "poiid":"124",
        "user_count": 243
        "users": [{//array
                "name": "张三",
                "sex": "boy",
                "photo_live": "mtA.jpg",
                "student_number": "STUDENT_NUMBER"
            },
            {
                "name": "李四",
                "sex": "girl",
                "photo_live": "mtB.jpg",
                "student_number": "STUDENT_NUMBER"
            }]
        }],
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
usersarray用户数组
namestring子节点名称
sexstring性别,”boy”或”girl”
photo_livestring用户的头像
student_numberstring用户的学工号
user_countstring在该poiid下的设备数量

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【批量查询用户的当前位置】

基本描述

第三方应用服务器通过本方法可以查询某些用户的当前位置。

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/wifiloc/getUsersLoc?access_token=[access_token]

请求结构体

json数据对象示例:

{
        "userList": ["1", "2", "3"] //用户学工号的列表
}

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": {
        "location": [
            {
                "student_number": '';
                "poiid": 714,
                "in_create_time": 1497497490
            }
        ]
    },
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
student_numberstring学工号
poiidintpoi的id
in_create_timeint定位到这个位置的时间

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【查询用户的历史轨迹】

基本描述

第三方应用服务器通过本方法可以查询某个用户的历史轨迹,目前支持7天内轨迹查询。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/wifiloc/getUserLocHist?student_number=[student_number]&start_ts=[start_ts]&end_ts=[end_ts]&access_token=[access_token]

参数说明

参数名必填类型说明
student_numbertruestring用户的学工号
start_tsfalseint查询轨迹的起始unix时间戳,默认为当前时刻时间戳
end_tsfalseint查询轨迹的结束unix时间戳,默认为当前时刻时间戳
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": {
        "location": [
            {
                "poiid": 714,
                "in_create_time": 1497497490
            },
            {
                "poiid": 720,
                "in_create_time": 1497491290
            }
        ]
    },
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
poiidintpoi的id
in_create_timeint用户进入到该poi的开始时间戳

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【用户位置变化实时推送】

基本描述

第三方应用服务器如果需要使用位置变化实时推送接口,首先设置服务器回调接口url,当订阅该应用的用户位置发生变化时,将会同POST请求方式把实时位置发送到该url。

设置请求方式

GET

设置请求url形式

https://api.weishao.com.cn/api/v2/index.php/wifiloc/setPushCallback?callback_url=[callback_url]&access_token=[access_token]

参数说明

参数名必填类型说明
callback_urltruestring回调接口的url,参数务必进行url encode
access_tokentruestring应用服务器获取的access_token

返回结果

json示例

{
    "data": {
    },
    "ret":0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

实时位置推送方式

POST

实时位置推送数据格式

{
    "domain": "DOMAIN",
    "user": [
        {
            "student_number": "STUDENT_NUMBER",
            "poiid": 714,
            "in_create_time": 1497497490
        }
    ]
}

接收参数说明

参数名类型说明
domainstring学校代码
student_numberstring用户的学工号
poiidintpoi的id
in_create_timeint定位到这个位置的时间

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

积分接口

【应用增加积分】

基本描述

第三方应用通过本方法可以增加用户平台积分,应用积分增加规则需满足积分策略,具体积分策略请参考学校配置。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/score/setTaskScore?access_token=[access_token]&app_version=1.0&task_type=10&score=1&student_number=[学号]

参数说明

参数名必填类型说明
student_numbertruestring用户的学工号
scoretrueint增加积分
task_typetrueint固定格式
wordstruestring积分说明,建议8-10字,例如:“成功曝光-增加5分”

返回结果

json示例

{
 "data":
    {"id":"2367","score":77},
 "ret":0,
 "errcode":0,
 "errmsg":"ok"
 }

返回结果字段说明

参数名类型说明
idint增加积分纪录ID
scoreint当前学号的总积分

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

access_token需要使用对应应用获取令牌,平台会将以该令牌对应的应用纪录积分日志

【应用消费积分】

基本描述

第三方应用通过本方法可以消费用户平台积分,应用积分消费规则需满足积分策略,具体积分策略请参考学校配置。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/user/consumeScore?access_token=[access_token]&app_version=1.0&task_type=10&score=1&student_number=[学号]

参数说明

参数名必填类型说明
student_numbertruestring用户的学工号
scoretrueint增加积分
task_typetrueint固定格式
wordstruestring积分说明,建议8-10字,例如:“礼品兑换50分”

返回结果

json示例

{
 "data":
    {"id":"2367","score":77},
 "ret":0,
 "errcode":0,
 "errmsg":"ok"
 }

返回结果字段说明

参数名类型说明
idint消费积分纪录ID
scoreint当前学号的总积分

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

access_token需要使用对应应用获取令牌,平台会将以该令牌对应的应用纪录积分日志

权限接口

【新建权限】

基本描述

第三方应用通过本接口可以在给定学校的组织树、标签、非常设机构中选择部分或全部人群,生成一个权限的范围,用于有人员限定相关的应用场景。

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/auth/addAuth

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
schooltruestring学校标识
auth_detailtruestring权限范围,其数据内容参见参数示例,需要将JSON转为字符串表示

参数示例

json示例

{
    "access_token": "access_token",
    "school": "school",
    "auth_detail": { 
        app_key: 应用app_key,
        auth_type: 权限类型,1:所有人可见(其他字段服务器不使用,其他参数可传'' || []),2:指定授权范围,
        org_list: 组织id(字符串类型),格式如: '1,2,3',
        user_list: 用户id(字符串类型), 格式如;'userId1, userId2',
        adhoc_list: 非常设机构id(字符串类型),格式如:'id1, id2',
        lable_list: 标签id(字符串类型),格式如:'labelId1,labelId2',
        recv_user_lable: 身份标示类型(array),格式如:[teacher,bachelor,other]
    }
 }

返回结果

json示例

{
 "data":
    {"authority_id": "2367"},
 "ret":0,
 "errcode":0,
 "errmsg":"ok"
 }

返回结果字段说明

参数名类型说明
authority_idint权限ID

访问权限限制

  • 访问级别:高级接口
  • 频次限制:是
  • 授权scope:all

【查询权限范围】

基本描述

第三方应用通过本接口可以查询由本应用添加的权限范围信息。

请求方式

GET或POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/auth/getAuth?access_token=[access_token]&school=[school]&authority_id=[authority_id]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
schooltruestring学校标识
authority_idtrueint权限ID

返回结果

json示例

{
 "data":
   {
        "app_key": "",  //应用app_key
       "auth_type": "1", //权限类型,1:所有人可见(所有人可见时,权限数据其他字段为[]),2:指定范围
       "org_list": [], //组织id数组,如: [{id1, path1, name1}, {id2, path2, name2}]
       "user_list": [], //用户id数组: 如: [{id1, path1, name1}, {id2, path2, name2}]
       "adhoc_list":[], //非常设机构数组 如:[{id1, name1}, {id2, name2}]
       "lable_list":[], //标签数组,如:[{id1, name1}, {id2, name2}]
       "recv_user_lable":[]  //身份标示,如:[teacher,bachelor,other]
    },
 "ret":0,
 "errcode":0,
 "errmsg":"ok"
 }

返回结果字段说明

参数名类型说明
app_keystring应用app_key
auth_typeint权限类型,1:所有人可见(所有人可见时,权限数据其他字段为[]),2:指定范围
org_listarray组织id数组,如:[
user_listarray用户id数组,如:[
adhoc_listarray非常设机构id数组,如:[
lable_listarray标签id数组,如:[
recv_user_lablearray身份标示,如:[teacher,bachelor,other]

访问权限限制

  • 访问级别:高级接口
  • 频次限制:是
  • 授权scope:all

【编辑权限范围】

基本描述

第三方应用通过本接口可以编辑由本应用添加的权限范围。

请求方式

POST

请求url形式

https://api.weishao.com.cn/api/v2/index.php/auth/editAuth

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
schooltruestring学校标识
authority_idtrueint权限ID
auth_detailtruestring权限范围,其数据内容参见参数示例,需要将JSON转为字符串表示

参数示例

json示例

{
    "access_token": "access_token",
    "school": "school",
    "authority_id": "authority_id",
    "auth_detail": { 
        app_key: 应用app_key,
        auth_type: 权限类型,1:所有人可见(其他字段服务器不使用,其他参数可传'' || []),2:指定授权范围,
        org_list: 组织id(字符串类型),格式如: '1,2,3',
        user_list: 用户id(字符串类型), 格式如;'userId1, userId2',
        adhoc_list: 非常设机构id(字符串类型),格式如:'id1, id2',
        lable_list: 标签id(字符串类型),格式如:'labelId1,labelId2',
        recv_user_lable: 身份标示类型(array),格式如:[teacher,bachelor,other]
    }
 }

返回结果

json示例

{
 "data":
   {
        "authority_id": "2367"
    },
 "ret":0,
 "errcode":0,
 "errmsg":"ok"
 }

返回结果字段说明

参数名类型说明
authority_idint权限ID

访问权限限制

  • 访问级别:高级接口
  • 频次限制:是
  • 授权scope:all

校园卡接口

【获取校园卡信息】

基本描述

第三方应用通过扫码,然后使用本接口,可获取用户的校园卡信息。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/QRCode/getIsTimeLimitedStrOk

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
schoolfalsestring学校代码
short_urltruestring扫码获得的链接信息

返回结果

返回值示例

{
    "data": {
        "type": "myCard",
        "retData": {
            "my_info": {
                "authority_identity": "bachelor",
                "celphone": "",
                "celphone_three": "15702030211",
                "celphone_two": "",
                "email": "",
                "head": "",
                "identity": "student",
                "identity_photo": "",
                "isLogin": "1",
                "landline": "",
                "landline_cornet": "",
                "mood_words": "",
                "name": "张三",
                "nick_name": "",
                "org": [
                    {
                        "end_time": "",
                        "flag_class": "",
                        "id": "1",
                        "last_time": "",
                        "name": "行政组织架构",
                        "organization_id": "1",
                        "parent": "0",
                        "path": "0,1",
                        "role": "",
                        "sort_string": "3000907",
                        "start_time": "",
                        "status": "0",
                        "type": "0"
                    }
                ],
                "org_id": [
                    "1"
                ],
                "path": "0,1",
                "phone_cornet": "55555",
                "phone_cornet_three": "",
                "phone_cornet_two": "1527777777",
                "pycc": "",
                "sex": "boy",
                "student_number": "zhangsan",
                "sznj": "2017",
                "tittle": "",
                "user_id": "93239",
                "user_type": "1",
                "verify_phone": "",
                "verify_phone_flag": "0",
                "zzmm": "",
                "jid": "93239_ligong",
                "orgPath": [
                    {
                        "name": "行政组织架构",
                        "organization_id": "1",
                        "type": "0"
                    }
                ],
                "l_subject": null,
                "l_title": null,
                "title": [
                    {
                        "org_name": [
                            "行政组织架构"
                        ],
                        "post_name": [
                            "主任"
                        ],
                        "organization_id": "1"
                    }
                ]
            }
        }
    },
    "ret": 0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

略,详见上例。

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

岗位接口

【获取岗位列表】

基本描述

第三方应用服务器通过本方法获取学校的岗位列表。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/post/getList?access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token

返回结果

返回值示例

{
    "data": [{
        "id": "1000",
        "post_name": "教职工",
        "sort": "1000"
    },
    {
        "id": "1001",
        "post_name": "学生",
        "sort": "1001"
    },
    {
        "id": "1002",
        "post_name": "其他",
        "sort": "1002"
    }],
    "ret": 0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
idstring岗位id
post_namestring岗位名称

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【获取岗位详情】

基本描述

第三方应用服务器通过本方法获取学校的岗位详情。
- 如果参数不传的话,会全量返回所有岗位信息。
- 如果传入岗位id,返回当前岗位的详细信息。
- 如果传入学工号,返回学工号对应的岗位详情。
- 如果传入管理范围,返回管理范围对应的岗位详情。

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/post/getDetailList?post_id=1000&student_number=1212&organization_id=2323&access_token=[access_token]

参数说明

参数名必填类型说明
access_tokentruestring应用服务器获取的access_token
post_idfalsestring岗位id
student_numberfalsestring用户学号
organization_idfalsestring组织节点id

返回结果

返回值示例

{
    "data": [{
        "student_number": "4545",
        "uid": "87878",
        "name": "张大山",
        "organization_id": "1212",
        "organization_name": "物理学院",
        "post_id": "454",
        "post_name": "处长"
    },
    {
        "student_number": "4545",
        "uid": "87878",
        "name": "徐悲鸿",
        "organization_id": "1212",
        "organization_name": "计算机学院",
        "post_id": "454",
        "post_name": "处长"
    }],
    "ret": 0,
    "errcode": 1000,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
student_numberstring学工号
uidstring用户id
namestring姓名
organization_idstring组织节点id
organization_namestring组织节点名称
post_idstring岗位id
post_namestring岗位名称
typeint组织类型:0表示默认组织,1表示非常设机构

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

职务接口

【获取职务列表接口】

基本描述

获取学校下的职务列表

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/post/getJobList

参数说明

参数名必填类型说明
access_tokenjsontrue应用服务器获取的access_token

返回结果

返回值示例

{
    "data": [
        {
            "id": "1599",
            "post_name": "职务验证"
        }
    ],
    "ret": 0,
    "errcode": 0,
    "errmsg": "ok"
}

返回结果字段说明

参数名类型说明
idint职务ID
post_namestring职务名称

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

【获取职务详情接口】

基本描述

获取职务下所有人员基本详情,返回该职务相关用户数据

请求方式

GET

请求url形式

https://api.weishao.com.cn/api/v2/index.php/post/getJobDetailList

参数说明

参数名必填类型说明
job_idinttrue职务ID
organization_idintfalse组织ID(可选参数,可作为筛选条件)
student_numberstringfalse学工号(可选参数,可作为筛选条件)
access_tokenjsontrue应用服务器获取的access_token

返回结果

返回值示例

{
    "data": [
        {
            "student_number": "LSZW6",
            "name": "老师职务6",
            "uid": "103420",
            "organization_id": "5914",
            "organization_name": "职务测试",
            "job_id": "1208",
            "job_name": "主任,副主任",
            "adhoc_name": null,
            "photo_live": "",
            "type": "0"
        }
    ],
    "ret": 0,
    "errcode": 1000,
    "errmsg": "OK"
}

返回结果字段说明

参数名类型说明
student_numberstring学工号
namestring姓名
uidint用户ID
organization_idint组织ID
organization_namestring组织名称
job_idint职务ID
job_namestring职务名称
adhoc_namestring所属非常设机构的组织名称
photo_livestring头像
typeint职务类型,0-组织;1-特殊组织

访问权限限制

  • 访问级别:普通接口
  • 频次限制:是
  • 授权scope:all

注意事项

错误码说明

errcode说明
1000成功
1001用户未登陆
1002用户verify不正确
1003app_key 错误或应用未上架
1004参数不全
1005用户为订阅该该应用,不能向其发送通知
1006所查信息不存在
1007未知的消息类型
1008消息格式错误
1009节点拥有子节点不能删除
1010标题过长
1011消息内容过长
1012数据已存在
1013时间格式不对,或者定时时间已过
1014参数domain错误:domain不存在
1015获取学校消息错误!
1016ldap服务器连接失败
1017用户名或密码错
1018用户已被禁用
1019oauth服务异常
1020用户数量大于限定值
2001学校未开通定位功能
2002所查位置节点不存在
2002学号不存在
2003所查信息不存在
2004二维码已失效