云直播Open API使用流程
账号信息查询接口,为用户提供了查询全时用户ID的一些方法。用户可以根据登录名称、邮箱或者电话信息,来查询在全时系统中所对应用户ID。注意,此用户ID在调用其他接口时会作为必填参数
1. 获得管理员全时用户ID
调用接口:
调用示例:
curl --location --request POST 'https://events-openapi.quanshi.com/eventopenapi/user/search/email' \
--header 'Content-Type: application/json' \
--header 'Nonce: 571163' \
--header 'CheckSum: {{checksum}}' \
--header 'AppKey: 4396b341fa9c2ab84' \
--header 'CurTime: 1638341017999' \
--data-raw '{
"email": "hhh_83@quanshi.com"
}'
返回示例
{
"timeStamp": 1666231309958,
"code": 200,
"msg": "Successfully to get the user by email!",
"data": {
"lastName": "陈",
"userStatus": 1,
"displayName": "陈兰兰",
"accountType": 1,
"mobile": "1560000000",
"customerCode": "002865",
"productStatus": 0,
"userId": 22540000,
"customerName": "",
"products": [
{
"accountStatus": 82,
"productId": 60000,
"accountCostStatus": 62
},
{
"accountStatus": 82,
"productId": 80,
"accountCostStatus": 62
}
],
"firstName": "",
"countryCode": "86",
"loginName": "dc3b34b0-7089-4788-a60e-b51bb7bec219",
"middleName": "",
"email": "chen4556@cn.com"
},
"requestId": "10.70.213.99_20221020_100149_1666231309893"
}
在返回中获得管理员全时用户ID, 参数名为userId.
2. 获得调用凭证Token
调用接口:
调用示例, 使用步骤1中获得的userId及其它参数
curl --location --request POST 'https://events-openapi.quanshi.com/eventopenapi/token/create' \
--header 'Content-Type: application/json' \
--header 'Nonce: 571163' \
--header 'CheckSum: {{checksum}}' \
--header 'AppKey: 4396b341f2ab84' \
--header 'CurTime: 1638341017999' \
--data-raw '{"userId":19533553}'
返回示例
{
"timeStamp": 1666231314356,
"code": 200,
"msg": "Successfully to create the token!",
"data": {
"productId": null,
"createTime": 1666231314326,
"expire": 86400,
"customerCode": "0001",
"userName": "陈兰兰",
"userId": 22547984,
"token": "6a1f660863e6df2ecedb4dc0f6b25cca",
"createDate": "2022-10-20 10:01:54"
},
"requestId": "10.70.212.228_20221020_100154_1666231314251"
}
获得返回中的参数token
3. 调用后续其他接口
以创建会议为例, 使用步骤2中获得的token
curl --location --request POST 'https://events-openapi.quanshi.com/eventopenapi/event/create' \
--header 'token: 2c6cfb06780e9b39cdc81c3d9ac4b16e' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "1014-1",
"startTime": 1666176075.132,
"length":120,
"eventForm":7,
"hostId": 19533553,
"summary": "",
"callbackUrl": "",
"joinLimit": 1,
"liveScreen": 0,
"manualService": 2,
"labels": ["t1", "t2"],
"customStr":{}
}'
使用第二步获得的token, 调用后续接口, 注意token有24小时的有效期。
返回示例
{
"timeStamp": 1666174877013,
"code": 200,
"msg": "Successfully to create the event!",
"data": {
"thirdConfId": "",
"isCycle": 0,
"title": "1014-1",
"joinLimit": 1,
"guestJoinInternalUrl": "https://s.qsh1.cn/a/NVB2Xv466C35",
"customStr": {},
"joinHostUrl": "https://s.qsh1.cn/a/OVB2XvD014A4",
"liveScreen": 0,
"audienceJoinUrl": "https://l.qsh1.cn/activity/4ekWQGl",
"manualService": 2,
"audienceUnionUrl": "https://l.qsh1.cn/activity/4ekWQGl",
"testAudienceUnionUrl": "",
"startTime": 1666176075,
"callbackUrl": "",
"confNodeType": 1,
"guestJoinUrl": "https://l.qsh1.cn/activity/4ekWQ3Ol",
"attendeeJoinUrl": "-",
"productType": 5,
"cycleInfo": null,
"summary": "",
"eventId": 7161210,
"hostJoinUrl": "https://n.qsh1.cn/k/cYBjDaGa225",
"eventForm": 7,
"length": 120,
"hostId": 19533553,
"useWaitingRoom": 0,
"labels": [
"t1",
"t2"
],
"billingCode": "45743306",
"pcode2": "80380993",
"pcode1": "53426683",
"conferenceId": "62522464",
"audienceJoinInternalUrl": "https://n.qsh1.cn/k/cYBjD0UeNTq",
"liveOpenFlag": 0,
"liveCover": null,
"liveLag": 0
},
"requestId": "10.70.213.66_20221019_182115_1666174875267"
}