top
关闭

开发者登录

认证类接口

主要使用场景:第三方应用接入平台后,需要与平台会话保持一致时使用

1、用户心跳会话保持7.0

基础 需要授权

客户端与服务器之间定时维护用户心跳

前置条件

a.获取接口访问凭证:accessToken
b.用户登录

请求说明

url https://gateway.hainan.edu.cn/user/openapi/user/heartbeat?usession_id=****&accessToken={{accessToken}}
请求方式 get
是否需要鉴权
请求数限制
接口方向 第三方应用->开放平台

参数说明

序号 字段名 约束 类型 长度 说明

1

usession_id

必选

String

64

用户会话编号

返回说明

序号 字段名 约束 类型 长度 说明

1

code

必选

String

6

结果编码,心跳成功000000,心跳失败100000,心跳失败110000(重复登录限制开启时存在该结果编码,result会返回相关重复日志信息,应用可选择使用)

2

message

必选

String

结果描述

3

result

可选

json

结果对象

3.1

usession_id

必选

string

用户会话编号

3.2

account_id

必选

string

帐号编号

3.3

user_id

必选

string

用户编号

3.4

other

可选

json

附加信息

3.4.1

top_org_id

可选

string

当前会话用户切换的机构、学校等组织编号

示例

							请求示例
https://gateway.hainan.edu.cn/user/openapi/user/heartbeat?usession_id=****&accessToken={{accessToken}}

返回示例
{
  "code": "000000",
  "message": "心跳成功",
  "result": {
    "usession_id": "746afa32-60ad-11e9-9c81-0200f7a5bbcc",
    "account_id": "cec2cdba-6013-11e9-9fd4-0200f7764488",
    "user_id": "cebe65e0-6013-11e9-9fd4-0200f7764488",
    "other": {
      "top_org_id": "42675838-5ff8-11e9-b985-0200f7efd26a"
    }
  }
}
						

参数说明

请求参数消息体-文本类
序号 字段名 约束 类型 长度 说明

1

msgType

必选

String

10

消息类型,此时固定为:text

1.1

text

必选

Json

-

text消息体

1.1.1

content

必选

String

消息内容

示例

{
	"msgtype": "text",
	"text": {
		"content": "zhxy msg text test 12"
	}
}
											

参数说明

请求参数消息体-link类
序号 字段名 约束 类型 长度 说明

1

msgType

必选

String

10

消息类型,此时固定为:link

2

link

必选

Json

-

link消息体

2.1

pcUrl

必选

String

PC端消息点击链接地址

2.2

appUrl

必选

String

移动客户端点击消息时跳转到的H5地址

2.3

title

必选

String

消息标题

2.4

busiId

必选

String

对应业务的id

2.5

content

必选

String

消息描述

2.6

picUrl

必选

String

图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图640*320,小图80*80。如不填,在客户端不显示图片

示例

{
	"msgtype": "link",
	"link": {
		"pcUrl": "http://www.baidu.com",
		"appUrl": "http://www.baidu.com",
		"picUrl": "http://xxx.yyy.com/zzz.jpg",
		"content": "百度一下",
		"title": "百度",
		"busiId":"AQWER1234"
	}
}
											

参数说明

请求参数消息体-oa类
序号 字段名 约束 类型 长度 说明

1

msgType

必选

String

10

消息类型,此时固定为:oa

2

busiId

必选

String

-

该条oa消息在业务系统对应的id

3

pcUrl

必选

String

消息点击链接地址

4

appUrl

必选

String

移动客户端点击消息时跳转到的H5地址

5

oa

必选

Json

-

oa类型消息体

5.1

head

必选

Json

255

消息头部Json

5.1.1

text

必选

String

255

消息的头部标题

5.1.2

bgColor

可选

String

消息头部的背景颜色。长度限制为8个英文字符,其中前2为表示透明度,后6位表示颜色值。不要添加0x。默认值:FFCC0000

5.2

body

可选

Json

消息体

5.2.1

title

可选

String

消息体的标题

5.2.2

content

可选

String

消息体的正文

5.2.3

imageUrl

可选

String

消息体中的图片url

5.2.4

fileCount

可选

String

自定义的附件数目。此数字仅供显示,不作验证

5.2.5

author

可选

String

自定义的作者名字

5.2.6

form

可选

Json数组

消息体的表单,最多6个

5.2.7

key

可选

String

消息体的关键字

5.2.8

value

可选

String

消息体的关键字对应的值