Short URL API
POSThttps://api.acedata.cloud/shorturl
This API can be used to shorten a given link.
Request Headers
acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token
Request Body
contentobject
需要缩短的长链接内容。
Response
Success200
请求成功。
Response Body
dataobject
Response output data.
urlstring
生成的短链接地址
successboolean
标识本次请求是否成功的标志位。
Example
{
"data": {
"url": "https://suro.id/abc123"
},
"success": true
}Failure400token_mismatched
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
响应的错误信息。
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400api_not_implemented
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
trace_idstring
本次请求的追踪 ID。
Example
{
"error": {
"code": "api_not_implemented",
"message": "The API is not implemented."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400disabled
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
响应的错误码。
messagestring
Error message of the response.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "disabled",
"message": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400bad_request
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
响应的错误码。
messagestring
Error message of the response.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "bad_request",
"message": "model is invalid."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400no_token
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "no_token",
"message": "No token specified for the request."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401invalid_token
未授权,授权令牌无效或缺失。
Response Body
errorobject
codestring
响应的错误码。
messagestring
Error message of the response.
trace_idstring
本次请求的追踪 ID。
Example
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401token_expired
未授权,授权令牌无效或缺失。
Response Body
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "token_expired",
"message": "token expired."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401token_mismatched
未授权,授权令牌无效或缺失。
Response Body
errorobject
codestring
Response error code.
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
Example
{
"error": {
"code": "token_mismatched",
"message": "token and api does not match."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure403used_up
未授权,授权令牌无效或缺失。
Response Body
errorobject
codestring
响应的错误码。
messagestring
Error message of the response.
trace_idstring
本次请求的追踪 ID。
Example
{
"error": {
"code": "used_up",
"message": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure404no_api
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
trace_idstring
本次请求的追踪 ID。
Example
{
"error": {
"code": "no_api",
"message": "API does not exist, please make sure url is correct."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure429too_many_requests
Too many requests, rate limit exceeded.
Response Body
errorobject
codestring
Response error code.
messagestring
响应的错误信息。
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "too_many_requests",
"message": "You have exceeded the rate limit."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure500api_error
服务器内部错误,服务端发生异常。
Response Body
errorobject
codestring
Response error code.
messagestring
响应的错误信息。
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Short link generation
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.
Shell
Python
JavaScript
Java
Go
PHP
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
