Short URL API
POSThttps://api.01ai.cloud/shorturl
該API可用於縮短給定的連結。
請求頭
acceptstring
指定伺服器返回的回應格式。
請選擇
authorizationstring
Bearer token
請求體
contentstring必填參數
需要縮短的長連結內容。
響應
成功200
請求成功。
響應體
dataobject
響應的輸出數據。
urlstring
生成的短連結地址
successboolean
標識本次請求是否成功的標誌位。
示例
{
"data": {
"url": "https://suro.id/abc123"
},
"success": true
}失敗400token_mismatched
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400api_not_implemented
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "api_not_implemented",
"message": "The API is not implemented."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400disabled
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"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"
}失敗400bad_request
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "bad_request",
"message": "model is invalid."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400no_token
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "no_token",
"message": "No token specified for the request."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401invalid_token
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401token_expired
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_expired",
"message": "token expired."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401token_mismatched
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "token and api does not match."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗403used_up
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗404no_api
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗429too_many_requests
請求過多,已超出速率限制。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗500api_error
伺服器內部錯誤,伺服器發生異常。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。

Integration workbench
Shell
Python
JavaScript
Java
Go
PHP
溫馨提示:對於流式請求,上面的代碼可能不完全適用。請參閱對接文檔以進行更改。
短連結生成
允许用通用余额
啟用「允許通用餘額」後,專屬餘額不足將自動使用通用餘額。

