阿里巴巴&阿里云出品

企业邮箱

用户指南

服务等级协议

用户操作API

作者: 浏览量:121 更新时间: 2019.10.22

概览

用户操作API,适用于CCPPath和OSSPath。

版本信息

版本 : 2.0.0

URI scheme

域名 : {domainId}.api.alicloudccp.com

基础路径 : /v2

协议 : HTTP, HTTPS

请求Content-Type

  • application/json

返回Content-Typ

  • application/json

API

创建用户

  1. POST /v2/user/create

说明

创建用户,只有管理员可以调用

Body参数

创建用户的请求参数

名称 : 创建用户请求标志 : 必填类型 : CreateUserRequest

响应

HTTP代码 说明 类型
201 创建用户成功 CreateUserResponse
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/create
请求 body
  1. {
  2. "avatar" : "http://a.b.c/ccp.jpg",
  3. "description" : "ccp team user",
  4. "email" : "123@ccp.com",
  5. "nick_name" : "ccpuser",
  6. "phone" : "13700000000",
  7. "role" : "user",
  8. "status" : "enabled",
  9. "user_id" : "ccpuserid",
  10. "user_name" : "abc"
  11. }

HTTP响应示例

响应 201
  1. {
  2. "avatar" : "http://a.b.c/ccp.jpg",
  3. "created_at" : 1567407718386,
  4. "default_drive_id" : "123",
  5. "description" : "ccp team user",
  6. "domain_id" : "hz999",
  7. "email" : "123@ccp.com",
  8. "nick_name" : "abc",
  9. "phone" : "13700000000",
  10. "role" : "user",
  11. "status" : "enabled",
  12. "updated_at" : 1567407718386,
  13. "user_id" : "ccpuserid",
  14. "user_name" : "name"
  15. }
响应 400
  1. {
  2. "code" : "InvalidParameter",
  3. "message" : "The input parameter {parameter_name} is not valid."
  4. }
响应 403
  1. {
  2. "code" : "ForbiddenNoPermission",
  3. "message" : "No Permission to access resource {resource_name}."
  4. }
响应 500
  1. {
  2. "code" : "InternalError",
  3. "message" : "The request has been failed due to some unknown error."
  4. }
响应 503
  1. {
  2. "code" : "ServiceUnavailable",
  3. "message" : "The request has failed due to a temporary failure of the server."
  4. }

删除用户

  1. POST /v2/user/delete

说明

只有管理员可以调用

Body参数

删除用户的请求参数

名称 : 删除用户请求标志 : 必填类型 : DeleteUserRequest

响应

HTTP代码 说明 类型
204 无返回内容 无内容
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/delete
请求 body
  1. {
  2. "user_id" : "ccpuserid"
  3. }

HTTP响应示例

响应 400
  1. {
  2. "code" : "InvalidParameter",
  3. "message" : "The input parameter {parameter_name} is not valid."
  4. }
响应 403
  1. {
  2. "code" : "ForbiddenNoPermission",
  3. "message" : "No Permission to access resource {resource_name}."
  4. }
响应 500
  1. {
  2. "code" : "InternalError",
  3. "message" : "The request has been failed due to some unknown error."
  4. }
响应 503
  1. {
  2. "code" : "ServiceUnavailable",
  3. "message" : "The request has failed due to a temporary failure of the server."
  4. }

获取用户信息

  1. POST /v2/user/get

说明

获取用户详细信息,普通用户只能获取自己的信息,管理员可以获取任意用户的信息。

Body参数

获取用户信息的请求参数

名称 : 获取用户信息请求标志 : 必填类型 : GetUserRequest

响应

HTTP代码 说明 类型
200 获取用户信息成功 GetUserResponse
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
404 指定的用户不存在 NotFoundError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/get
请求 body
  1. {
  2. "user_id" : "string"
  3. }

HTTP响应示例

响应 200
  1. {
  2. "avatar" : "http://a.b.c/ccp.jpg",
  3. "created_at" : 1567407718386,
  4. "default_drive_id" : "123",
  5. "description" : "ccp team user",
  6. "domain_id" : "hz999",
  7. "email" : "123@ccp.com",
  8. "nick_name" : "abc",
  9. "phone" : "13700000000",
  10. "role" : "user",
  11. "status" : "enabled",
  12. "updated_at" : 1567407718386,
  13. "user_id" : "ccpuserid",
  14. "user_name" : "name"
  15. }
响应 400
  1. {
  2. "code" : "InvalidParameter",
  3. "message" : "The input parameter {parameter_name} is not valid."
  4. }
响应 403
  1. {
  2. "code" : "ForbiddenNoPermission",
  3. "message" : "No Permission to access resource {resource_name}."
  4. }
响应 404
  1. {
  2. "code" : "NotFound",
  3. "message" : "The resource {resource_name} cannot be found. Please check."
  4. }
响应 500
  1. {
  2. "code" : "InternalError",
  3. "message" : "The request has been failed due to some unknown error."
  4. }
响应 503
  1. {
  2. "code" : "ServiceUnavailable",
  3. "message" : "The request has failed due to a temporary failure of the server."
  4. }

获取用户列表

  1. POST /v2/user/list

说明

只有管理员可以调用

Body参数

列举用户的请求参数

名称 : 列举用户请求标志 : 必填类型 : ListUserRequest

响应

HTTP代码 说明 类型
200 列举用户列表成功 ListUserResponse
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/list
请求 body
  1. {
  2. "limit" : 10,
  3. "marker" : "marker"
  4. }

HTTP响应示例

响应 200
  1. {
  2. "items" : [ {
  3. "avatar" : "http://a.b.c/ccp.jpg",
  4. "created_at" : 1567407718386,
  5. "default_drive_id" : "123",
  6. "description" : "ccp team user",
  7. "domain_id" : "hz999",
  8. "email" : "123@ccp.com",
  9. "nick_name" : "abc",
  10. "phone" : "13700000000",
  11. "role" : "user",
  12. "status" : "enabled",
  13. "updated_at" : 1567407718386,
  14. "user_id" : "ccpuserid",
  15. "user_name" : "name"
  16. } ],
  17. "next_marker" : "nextmarker"
  18. }
响应 400
  1. {
  2. "code" : "InvalidParameter",
  3. "message" : "The input parameter {parameter_name} is not valid."
  4. }
响应 403
  1. {
  2. "code" : "ForbiddenNoPermission",
  3. "message" : "No Permission to access resource {resource_name}."
  4. }
响应 500
  1. {
  2. "code" : "InternalError",
  3. "message" : "The request has been failed due to some unknown error."
  4. }
响应 503
  1. {
  2. "code" : "ServiceUnavailable",
  3. "message" : "The request has failed due to a temporary failure of the server."
  4. }

查询用户

  1. POST /v2/user/search

说明

该接口将会根据条件查询用户,只有管理员可以调用

Body参数

查询用户的请求参数

名称 : 查询用户请求标志 : 必填类型 : SearchUserRequest

响应

HTTP代码 说明 类型
200 查询用户成功 ListUserResponse
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/search
请求 body
  1. {
  2. "email" : "abc@ccp.com",
  3. "limit" : 10,
  4. "marker" : "marker",
  5. "nick_name" : "la",
  6. "phone" : "13700000000",
  7. "role" : "user",
  8. "status" : "enabled",
  9. "user_name" : "abc"
  10. }

HTTP响应示例

响应 200
  1. {
  2. "items" : [ {
  3. "avatar" : "http://a.b.c/ccp.jpg",
  4. "created_at" : 1567407718386,
  5. "default_drive_id" : "123",
  6. "description" : "ccp team user",
  7. "domain_id" : "hz999",
  8. "email" : "123@ccp.com",
  9. "nick_name" : "abc",
  10. "phone" : "13700000000",
  11. "role" : "user",
  12. "status" : "enabled",
  13. "updated_at" : 1567407718386,
  14. "user_id" : "ccpuserid",
  15. "user_name" : "name"
  16. } ],
  17. "next_marker" : "nextmarker"
  18. }
响应 400
  1. {
  2. "code" : "InvalidParameter",
  3. "message" : "The input parameter {parameter_name} is not valid."
  4. }
响应 403
  1. {
  2. "code" : "ForbiddenNoPermission",
  3. "message" : "No Permission to access resource {resource_name}."
  4. }
响应 500
  1. {
  2. "code" : "InternalError",
  3. "message" : "The request has been failed due to some unknown error."
  4. }
响应 503
  1. {
  2. "code" : "ServiceUnavailable",
  3. "message" : "The request has failed due to a temporary failure of the server."
  4. }

更新用户信息

  1. POST /v2/user/update

说明

用户可以修改自己的description,nick_name,avatar;管理员在用户基础上还可修改status(可以修改任意用户);超级管理员在管理员基础上还可修改role(可以修改任意用户)。

Body参数

更新用户的请求参数

名称 : 更新用户信息请求标志 : 必填类型 : UpdateUserRequest

响应

HTTP代码 说明 类型
200 更新用户成功 UpdateUserResponse
400 1. InvalidParameterError:请求参数不正确 2. InvalidRequestJSONFormatError 请求JSON格式错误 InvalidParameterError
403 1.ForbiddenNoPermissionError 没有用户接口权限 2.ForbiddenAccountNotFoundError 账号没找到 ForbiddenNoPermissionError
404 指定的用户不存在 NotFoundError
500 服务内部故障 InternalErrorError
503 服务临时不可用 ServiceUnavailableError

标签

  • user

HTTP请求示例

请求 path
  1. /v2/user/update
请求 body
  1. {
  2. "avatar" : "http://a.b.c/ccp.jpg",
  3. "description" : "ccp team user",
  4. "email" : "123@ccp.com",
  5. "nick_name" : "ccpuser",
  6. "phone" : "13700000000",
  7. "role" : "user",
  8. "status" : "enabled",
  9. "user_id" : "ccpuserid"
  10. }

HTTP响应示例

响应 200
  1. {
  2. "avatar" : "http://a.b.c/ccp.jpg",
  3. "created_at" : 1567407718386,
  4. "default_drive_id" : "123",
  5. "description" : "ccp team user",
  6. "domain_id" : "hz999",
  7. "email" : "123@ccp.com",

5折钜惠,豪礼相送:尊享1V1专员服务、赠送“对接钉钉”服务、赠送英文.cn/.com顶级域名

填写资料马上体验阿里企业邮箱

工作时间5-10分钟将由1对1顾问为您提供尊享服务

  • *公   司

    公司名称不能为空

  • *帐号数

    帐号数不能为空或输入有误

  • *电   话

    电话不能为空或输入有误

  • 联系人
  • 域名