智慧服务,成就美好体验 项目咨询

主页 > 服务与支持 > 开发平台 > 服务端API参考 > 用户管理 添加用户

入门使用

添加用户

更新时间:2019-11-20

描述

企业管理员通过该接口添加企业用户。

接口原型

表1 接口原型

请求方法

POST

请求地址

/rest/usg/datacenter/v1/corp/member

传输协议

HTTPS

请求参数

表2 参数说明

参数

是否必须

类型

位置

描述

Authorization

String

Header

授权令牌。将执行鉴权响应的accessToken进行Base64转码操作

样例:Basic Base64(accessToken)

id

String

Body

企业用户的唯一标识,若不输入,后台生成uuid。

长度:0-64位。

name

String

Body

企业用户姓名。

长度:1-64位。

englishName

String

Body

企业用户的英文姓名。

长度:0-64位。

account

String

Body

企业用户帐号,若携带则以携带为准,否则后台自动生成。

帐号只能包含大小写字母、数字、_、-、.、@符号,不能为纯数字和@后面带.号。

长度:0-64位。

phone

String

Body

手机号,必须加上国家码。

例如中国大陆手机为“+86xxxxxxxxxxx”。当填写手机号时 “country”参数必填。

手机号只允许输入纯数字。

说明:手机号或者邮箱至少填写一个。

长度:0-32位。

country

String

Body

手机号所属的国家

默认值:chinaPR。

长度:0-255位。

pwd

String

Body

企业用户帐号的密码。若携带则实际携带为准,否则后台默认生成。

email

String

Body

邮箱。

长度:0-255位。

vmrId

String

Body

虚拟会议室ID,若不携带则后台默认生成。

长度:0-32位。

deptCode

String

Body

部门编号,若不携带则默认根部门。

默认值:1

长度:0-32位。

signature

String

Body

签名。

长度:0-128位。

status

Integer

Body

用户状态。

  • 0:正常
  • 1:停用

默认值:0

function

UserFunctionDTO

Body

用户功能位。

sendNotify

String

Body

是否发送邮件和短信通知。

  • 0:不发送
  • 不填或者其他值就发送

sortLevel

Integer

Body

通讯录排序等级,序号越低优先级越高。

默认值:10000

范围:1-10000。

hidePhone

Boolean

Body

是否隐藏手机号码。

默认值:false

表3 UserFunctionDTO 数据结构

参数

类型

描述

enableRoom

Boolean

是否开启智能协同白板功能。如果开启,表示该帐号是给智能协同白板使用,占用企业智能协同白板的资源,如果资源不足,则无法开启。

默认值:false。

响应参数

表4 参数说明

参数

类型

描述

returnCode

String

业务返回码。

returnMessage

String

返回描述。

achievementTime

String

响应产生时间。

requestId

String

请求唯一标识。

data

QueryUserResultDTO

查询用户的返回结果。

请求消息示例

POST /rest/usg/datacenter/v1/corp/member
Connection: keep-alive
Content-Type: application/json
Authorization: Basic UnhsbTBjNUdOWU9jZlUwbWQxcU82Y1QwZndOSDhOblNz
Content-Length: 173
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)

{
    "account": "test010",
    "country": "chinaPR",
    "deptCode": "1",
    "email": "test010@huawei.com",
    "name": "test010",
    "phone": "+86136********",
    "pwd": "*********"
}
 

响应消息示例

HTTP/1.1 200 
Date: Fri, 12 Apr 2019 08:00:18 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 160
Connection: keep-alive
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: api-gateway
X-Request-Id: ebbb9b1e50d1ec63b78d8484d170173f

{
    "returnCode": "000000000",
    "returnMessage": "Success",
    "achievementTime": "2019-04-12 07:59:06.617",
    "requestId": "ebbb9b1e50d1ec63b78d8484d170173f",
    "data": {
        "id": "ff8080816a52c253016a630b31e40196",
        "userAccount": "test010",
        "name": "test010",
        "phone": "+861368********",
        "country": "chinaPR",
        "email": null,
        "sipNum": "+86571100252",
        "vmrList": [
        {
            "id": "ff8080816a52c253016a630b31ed0198",
            "vmrId": "912922171",
            "vmrName": "test010's meeting room",
            "vmrPkgId": null,
            "vmrPkgName": null,
            "vmrPkgParties": null,
            "status": 0
        }],
        "deptCode": "1",
        "deptName": "test002",
        "deptNamePath": "test002",
        "userType": 2,
        "adminType": 2,
        "signature": null,
        "corp": null,
        "status": 0
    }
}
 

CURL命令示例

curl -k -i -H 'content-type: application/json' -X POST -H 'Authorization: Basic VUVwVU82SWFISU0ySWlKaEdoRllRUXk0MUZnbk00Mkpk' -d '{"account": "test010","country": "chinaPR","deptCode": "1","email": "test010@huawei.com","name": "test010","phone": "+86136********","pwd": "********"}' https://api.meeting.huaweicloud.com/rest/usg/datacenter/v1/corp/member