Creates an activation code.

Usage notes

If you want to import the information of migration sources by using an activation code, you can call this operation to create one.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateAccessToken

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

Name String No test_name

The name of the activation code.

Description String No This is an activation code for importing the information of migration sources

The description of the activation code.

Count String No 10

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

Default value: 100.

TimeToLiveInDays String No 30

The validity period of the activation code. The activation code can no longer be used to import the information of migration sources after the code expires. Unit: days. Valid values: 1 to 90.

Default value: 30.

Response parameters

Parameter Type Example Description
RequestId String DB4A7EA2-6FDA-5655-B067-854532FB****

The ID of the request.

AccessTokenCode String B57QoTXEA2Tytr0uZWoNY5Aju5Jt****

The value of the activation code. The value is returned only once after the CreateAccessToken operation is called and cannot be subsequently queried. Make sure that you properly save the return value.

AccessTokenId String at-bp1akz2zp67r0k6r****

The ID of the activation code.

Examples

Sample request

http(s)://smc.aliyuncs.com/?Action=CreateAccessToken
&Name=test_name
&Description=This is an activation code for importing the information of migration sources
&Count=100
&TimeToLiveInDays=30
&<Common request parameters>

Sample success responses

XML format

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

<CreateAccessTokenResponse>
    <RequestId>DB4A7EA2-6FDA-5655-B067-854532FB****</RequestId>
    <AccessTokenCode>B57QoTXEA2Tytr0uZWoNY5Aju5Jt****</AccessTokenCode>
    <AccessTokenId>at-bp1akz2zp67r0k6r****</AccessTokenId>
</CreateAccessTokenResponse>

JSON format

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

{
  "RequestId" : "DB4A7EA2-6FDA-5655-B067-854532FB****",
  "AccessTokenCode" : "B57QoTXEA2Tytr0uZWoNY5Aju5Jt****",
  "AccessTokenId" : "at-bp1akz2zp67r0k6r****"
}

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.