You need to enable JavaScript to run this app.
导航

AssignRoleToUser

最近更新时间2023.12.25 20:24:13

首次发布时间2022.11.25 11:53:32

调用AssignRoleToUser接口给用户分配角色。

使用说明

  • 接口名称:AssignRoleToUser
  • 请求方式:POST
  • 接口地址:/?Action=AssignRoleToUser&Version=2022-10-12

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

AssignRoleToUser

请求名称。

Version

String

2022-10-12

请求版本。

ServiceName : apmplus_openapi
Region : cn-beijing 
Content-Type : application/json

Body

参数

类型

是否必选

示例值

描述

role_type

int8

1

用户角色。

  • 1:成员
  • 2:管理员

user_id

array of int32

[123]

用户ID。

返回参数

参数

类型

示例值

描述

error_msg

string

-

错误信息,成功为空。

error_no

int32

0

错误码,成功为0。

请求示例

POST https://open.volcengineapi.com/?Action=AssignRoleToUser&Version=2022-10-12 
{
    "role_type": 1,
    "user_id": [123]
}

返回示例

正常返回示例

{
    "error_no": 0,
    "error_msg": ""
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "2018****22D30",
        "Action": "AssignRoleToUser",
        "Version": "2022-10-12",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}