Platform Token
The Ace Data Cloud platform provides a "Platform Token" mechanism, allowing developers to manage various resources on the Ace Data Cloud platform through the API, such as querying service lists, application lists, order lists, call records, balances, and more.
The functionality of the platform token is similar to the user token after logging into the Ace Data Cloud platform, and it can be used to access all platform management interfaces that require authentication. However, unlike the user token:
- The platform token is valid permanently and does not expire.
- The user token will expire after a certain period, requiring re-login after expiration.
Therefore, the platform token is very suitable for long-term use in backend services for automated management and monitoring.
¶ Creating a Platform Token
You can create a platform token on the https://platform.acedata.cloud/console/platform-tokens page, as shown in the image:

After creation, please keep your platform token safe.
¶ Creating a Platform Token via API
You can also create a platform token through the API.
- Request Method: POST
- Request URL:
https://platform.acedata.cloud/api/v1/platform-tokens/ - Request Headers:
- accept:
application/json - authorization:
Bearer {token}
- accept:
Where {token} can be an existing platform token or user token.
CURL request example:
curl -X POST \
-H "accept: application/json" \
-H "authorization: Bearer {token}" \
"https://platform.acedata.cloud/api/v1/platform-tokens/"
Example of return result:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_id": "b87f67c1-b04f-4332-99a1-7a5e651331c6",
"token": "platform-v1-5b8fbef60bc547098034db3e9f36a623731c490abe854f72972a0a3473b4c56b",
"expiration": null,
"used_at": null,
"created_at": "2024-08-01T10:00:00.000000Z",
"updated_at": "2024-08-01T10:00:00.000000Z"
}
The token field is your platform token, starting with the prefix platform-.
¶ Querying the Platform Token List
- Request Method: GET
- Request URL:
https://platform.acedata.cloud/api/v1/platform-tokens/ - Request Headers:
- accept:
application/json - authorization:
Bearer {token}
- accept:
CURL request example:
curl -X GET \
-H "accept: application/json" \
-H "authorization: Bearer {token}" \
"https://platform.acedata.cloud/api/v1/platform-tokens/"
Example of return result:
{
"count": 2,
"results": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_id": "b87f67c1-b04f-4332-99a1-7a5e651331c6",
"token": "platform-v1-5b8fbef60bc547098034db3e9f36a623731c490abe854f72972a0a3473b4c56b",
"expiration": null,
"used_at": "2024-08-16T07:51:15.603207Z",
"created_at": "2024-08-01T10:00:00.000000Z",
"updated_at": "2024-08-01T10:00:00.000000Z"
}
]
}
¶ Deleting a Platform Token
- Request Method: DELETE
- Request URL:
https://platform.acedata.cloud/api/v1/platform-tokens/{id}/ - Request Headers:
- accept:
application/json - authorization:
Bearer {token}
- accept:
Where {id} is the UUID of the platform token.
CURL request example:
curl -X DELETE \
-H "accept: application/json" \
-H "authorization: Bearer {token}" \
"https://platform.acedata.cloud/api/v1/platform-tokens/{id}/"
After successful deletion, it returns HTTP 204 No Content.
¶ Usage
When calling any platform API that requires authentication, you only need to set the authorization in the request header to Bearer {platform_token}, for example:
curl -X GET \
-H "accept: application/json" \
-H "authorization: Bearer platform-v1-5b8fbef60bc547098034db3e9f36a623731c490abe854f72972a0a3473b4c56b" \
"https://platform.acedata.cloud/api/v1/applications/"
¶ Code Example
Python:
import requests
# Create platform token
url = "https://platform.acedata.cloud/api/v1/platform-tokens/"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}"
}
response = requests.post(url, headers=headers)
platform_token = response.json()["token"]
print(f"Platform Token: {platform_token}")
# Use platform token to query application list
headers["authorization"] = f"Bearer {platform_token}"
response = requests.get("https://platform.acedata.cloud/api/v1/applications/", headers=headers)
print(response.json())
