All Products
Search
Document Center

ApsaraMQ for MQTT:CreateGroupId

Last Updated:Dec 26, 2024

Creates a group ID. Before you connect producers and consumers to an ApsaraMQ for MQTT broker to send and receive messages, you must specify a unique ID for each client for identification. A client ID is in the format of \\\<GroupID>@@@\\\<DeviceID>. In the preceding format, DeviceID is the custom ID that you specify for the client, and GroupID is the ID of the group that you create on the ApsaraMQ for MQTT broker in advance.

Operation description

Each successful call to the CreateGroupId operation increases the messaging transactions per second (TPS) by one. This affects the billing of your instance. For more information, see Billing rules.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the group that you want to create. The group ID must meet the following conventions:

  • The ID must be 7 to 64 characters in length. It must start with GID_ or GID- and can contain only letters, digits, hyphens (-), and underscores (_).
  • The ID cannot be changed after the group is created. For more information, see Terms .
GID_test
InstanceIdstringYes

The ID of the ApsaraMQ for MQTT instance to which the group belongs.

mqtt-cn-0pp1ldu****
Note For information about other parameters, see Common parameters and Endpoints .

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID. This parameter is a common parameter.

2C7D722D-0F3D-4415-A9CD-A464D82C****

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400GroupIdAlreadyExsitedThe specified GroupId already exists.
400GroupIdAlreadyUsedByOtherUsersThe current GroupId is used by another user. Please change to a different GroupId.
400ParameterFieldCheckFailedFailed to validate the parameters. The parameters may be missing or invalid.
400InstancePermissionCheckFailedAn error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings.
400InstanceNotFoundFailed to find the instance. The instanceId may be invalid.
400PermissionCheckFailedAn error occurred while validating the resource permissions. Please check the account that created the instance, topic, and GroupId, and check their permission settings.
500CreateGroupIdErrorFailed to create GroupId. Try again later.
500InternalErrorAn error occurred while processing your request. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history