添加消息通知联系人。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
resourcemanager:AddMessageContact | create | *MessageContact acs:resourcemanager:*:{#accountId}:messagecontact/* |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Name | string | 是 | 联系人的名称。 联系人的名称在资源目录内必须唯一。 格式:2~12 个英文字母或汉字。 | tom |
EmailAddress | string | 是 | 联系人的邮箱地址。 添加邮箱地址后,您需要继续调用 SendEmailVerificationForMessageContact 向该邮箱地址发送验证信息,通过验证后,该联系人的邮箱地址才能生效。 | someone***@example.com |
PhoneNumber | string | 否 | 联系人的手机号码。 格式: 说明
仅支持填写 86-<手机号码> 的中国内地手机号码。
添加手机号码后,您需要继续调用 SendPhoneVerificationForMessageContact 向该手机号码发送验证信息,通过验证后,该联系人的手机号码才能生效。 | 86-139****1234 |
Title | string | 是 | 联系人的职位。 枚举值:
| TechnicalDirector |
MessageTypes | array | 是 | 联系人接收的消息分类。 | |
string | 是 | 联系人接收的消息分类。 枚举值:
| AccountExpenses |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "2DFCE4C9-04A9-4C83-BB14-FE791275EC53",
"Contact": {
"ContactId": "c-qL4HqKONzOM7****",
"CreateDate": "2023-03-27 17:19:21"
}
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter.Name | You must specify Name. | 参数Name为必填参数。 |
400 | InvalidParameter.Name | The Name is invalid. | Name参数非法,可以包含汉字、英文。 |
400 | InvalidParameter.Name.Length | The Name exceeds the length limit. | Name长度超限,必须为2~12字符,可以包含汉字、英文。 |
400 | InvalidParameter.Name.AlreadyUsed | The Name already exists. Please change to another name. | 资源目录中已存在该联系人名称,请更换。 |
400 | MissingParameter.EmailAddress | You must specify EmailAddress. | EmailAddress参数缺失。 |
400 | InvalidParameter.EmailAddress | The EmailAddress is invalid. | 邮箱格式无效。 |
400 | MissingParameter.PhoneNumber | You must specify PhoneNumber. | PhoneNumber参数缺失。 |
400 | InvalidParameter.PhoneNumber | The PhoneNumber is invalid. | 手机号格式无效。 |
400 | MissingParameter.Title | You must specify Title. | Title参数缺失。 |
400 | InvalidParameter.Title | The Title is invalid. | 职位参数无效。 |
400 | MissingParameter.MessageTypes | You must specify MessageTypes. | MessageTypes参数缺失。 |
400 | InvalidParameter.MessageTypes | The MessageTypes is invalid. | 消息分类参数无效。 |
400 | LimitExceeded.Contacts | The maximum number of contacts in a resource directory exceeds the limit. | 联系人数量超出最大限额。 |
400 | InvalidParameter.MobileCountryCode | The current site does not support the country code. | 当前站点不支持您输入的国家码。 |
400 | InvalidParameter.EmailAddress.Length | The EmailAddress exceeds the length limit. | EmailAddress长度超限。 |
429 | ConcurrentCallNotSupported | The operation conflicts with other operations. Please try again later. | 当前操作与其他操作冲突,请稍后再试。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2023-07-25 | OpenAPI 错误码发生变更 | 查看变更详情 |