Queries activation codes and the usage details of the activation codes.

Description

You can call this operation to query activation codes and the usage details of the activation codes.

An activation code can be in the activated, unactivated, or expired state.

Request parameters

Parameter Type Required Example Description
Action String Yes ListAccessTokens

The operation that you want to perform. Set the value to ListAccessTokens.

AccessTokenId.N String No at-bp1akz2zp67r0k6r****

The IDs of the activation codes that you want to query.

Name String No test_name

The name of the activation code.

Status String No activated

The status of the activation code. Valid values:

  • activated: The activation code is activated.
  • unactivated: The activation code is not activated.
  • expired: The activation code has expired.

Response parameters

Parameter Type Example Description
RequestId String E2DA3097-79B9-53AE-B0DF-281DC54F****

The ID of the request.

AccessTokens Array of AccessToken

The activation codes returned.

AccessToken
AccessTokenId String at-bp1akz2zp67r0k6r****

The ID of the activation code.

TimeToLiveInDays String 30

The validity period of the activation code. Valid values: 1 to 90. Default value: 30.

Count String 100

The maximum number of times that the activation code can be used. Valid values: 1 to 1000.

Default value: 100.

RegisteredCount String 5

The number of migration sources whose information has been imported to Server Migration Center (SMC) by using the activation code.

CreationTime String 2022-09-09T02:35:44Z

The time when the activation code was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Status String activated

The status of the activation code. Valid values:

  • activated: The activation code is activated.
  • unactivated: The activation code is not activated.
  • expired: The activation code has expired.
Name String test_name

The name of the activation code.

Description String This is an activation code

The description of the activation code.

TotalCount Integer 2

The total number of activation codes returned.

PageSize Integer 1

The page number of the returned page.

PageNumber Integer 20

The number of entries returned per page. Valid values:

  • 10
  • 20
  • 50

Default value: 20.

Examples

Sample request

http(s)://smc.aliyuncs.com/?Action=ListAccessTokens
&AccessTokenId=["at-bp1akz2zp67r0k6r****"]
&Name=test_name
&Status=activated
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListAccessTokensResponse>
    <RequestId>E2DA3097-79B9-53AE-B0DF-281DC54F****</RequestId>
    <AccessTokens>
        <AccessTokenId>at-bp1akz2zp67r0k6r****</AccessTokenId>
        <TimeToLiveInDays>30</TimeToLiveInDays>
        <Count>100</Count>
        <RegisteredCount>5</RegisteredCount>
        <CreationTime>2022-09-09T02:35:44Z</CreationTime>
        <Status>activated</Status>
        <Name>test_name</Name>
        <Description>This is an activation code</Description>
    </AccessTokens>
    <TotalCount>2</TotalCount>
    <PageSize>1</PageSize>
    <PageNumber>20</PageNumber>
</ListAccessTokensResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "E2DA3097-79B9-53AE-B0DF-281DC54F****",
  "AccessTokens" : [ {
    "AccessTokenId" : "at-bp1akz2zp67r0k6r****",
    "TimeToLiveInDays" : "30",
    "Count" : "100",
    "RegisteredCount" : "5",
    "CreationTime" : "2022-09-09T02:35:44Z",
    "Status" : "activated",
    "Name" : "test_name",
    "Description" : "This is an activation code"
  } ],
  "TotalCount" : 2,
  "PageSize" : 1,
  "PageNumber" : 20
}

Error codes

HTTP status code Error code Error message Description
500 InternalError An error occurred while processing your request. Please try again. If the problem still exists, please submit a ticket. The error message returned because an internal error has occurred. Try again later. If the error persists, submit a ticket.

For a list of error codes, visit the API Error Center.