调用CreateGroupId创建Group ID。

说明 每成功调用一次CreateGroupId接口,都会计算为一次消息TPS,从而影响您的计费。详细计费信息,请参见计费说明

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateGroupId

系统规定参数。取值:CreateGroupId

GroupId String GID_test

您需创建的 Group ID。取值说明如下:

  • 以 "GID_" 或者 "GID-" 开头,只能包含字母、数字、连字符(-)和下划线(_),长度限制在 7~64 字符之间。
  • Group ID 一旦创建,则无法修改,详情请参见名词解释
InstanceId String mqtt-cn-0pp1ldu****

创建的Group ID所在实例的ID。

RegionId String cn-hangzhou

创建的Group ID所在实例的地域。

说明 更多参数说明,请参见公共参数服务接入点

返回数据

名称 类型 示例值 描述
RequestId String 2C7D722D-0F3D-4415-A9CD-A464D82C****

公共参数,每个请求的ID都是唯一的。

示例

请求示例

http(s)://onsmqtt.cn-hangzhou.aliyuncs.com/?Action=CreateGroupId
&GroupId=GID_test
&InstanceId=mqtt-cn-0pp1ldu****
&RegionId=cn-hangzhou
&<公共请求参数>

正常返回示例

XML格式

<CreateGroupIdResponse>
  <RequestId>2C7D722D-0F3D-4415-A9CD-A464D82C****</RequestId>
</CreateGroupIdResponse>

JSON格式

{
  "RequestId": "2C7D722D-0F3D-4415-A9CD-A464D82C****"
}

错误码

HttpCode 错误码 错误信息 描述
500 CreateGroupIdError Failed to create GroupId. Try again later. 创建Group ID请求执行失败,请稍后重试。
400 GroupIdAlreadyExsited The specified GroupId already exists. 当前Group ID已经存在。
400 GroupIdAlreadyUsedByOtherUsers The current GroupId is used by another user. Please change to a different GroupId. 当前Group ID已经被其他用户占用,请更换其他名称。
500 InternalError An error occurred while processing your request. Try again later. MQTT后端服务异常,请重试。
400 ParameterFieldCheckFailed Failed to validate the parameters. The parameters may be missing or invalid. 参数校验失败,可能缺失或者传入值非法。
400 InstancePermissionCheckFailed An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. 实例权限校验失败,请确认MQTT实例的所属关系以及授权策略。
400 InstanceNotFound Failed to find the instance. The instanceId may be invalid. 无法找到实例。
400 PermissionCheckFailed An error occurred while validating the resource permissions. Please check the account that created the instance, topic, and GroupId, and check their permission settings. 资源权限校验失败,请检查实例、Topic和Group ID的所属权限和授权策略。

访问错误中心查看更多错误码。