自动带宽
移除代币合约
从您的自动带宽代币列表中移除一个 TRC-20 合约
DELETE
/
v1
/
bandwidth
/
auto
/
contracts
/
{address}
移除代币合约
curl --request DELETE \
--url https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}import requests
url = "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"address": "<string>",
"deleted": true
}移除代币合约
从您的代币列表中移除一个合约。仍有订阅在使用的合约无法移除:请先更改该订阅的token 或 contract,或将其删除。需要 buy_bandwidth 权限。
路径参数
响应
示例
curl -X DELETE https://api.tronrental.com/v1/bandwidth/auto/contracts/TYourTokenContract1234567890abcdef \
-H "X-API-Key: your_api_key"
import requests
resp = requests.delete(
"https://api.tronrental.com/v1/bandwidth/auto/contracts/TYourTokenContract1234567890abcdef",
headers={"X-API-Key": "your_api_key"},
)
print(resp.json())
const resp = await fetch(
"https://api.tronrental.com/v1/bandwidth/auto/contracts/TYourTokenContract1234567890abcdef",
{ method: "DELETE", headers: { "X-API-Key": "your_api_key" } },
);
console.log(await resp.json());
Response
{
"address": "TYourTokenContract1234567890abcdef",
"deleted": true
}
错误
| 状态 | 代码 | 触发条件 |
|---|---|---|
400 | INVALID_ADDRESS | address 不是有效的 TRON 地址 |
403 | FORBIDDEN | API 密钥缺少 buy_bandwidth 权限 |
404 | NOT_FOUND | 该合约不在您的列表中 |
409 | AUTO_BW_CONTRACT_IN_USE | 有订阅是为该合约设置的 |
⌘I
移除代币合约
curl --request DELETE \
--url https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}import requests
url = "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/bandwidth/auto/contracts/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"address": "<string>",
"deleted": true
}