API Endpoints
POST https://web.apitrx.com/edit
Parameters
Parameters | Type | Description | Example |
---|---|---|---|
apikey | string | TG Bot gets apikey | 83928AFB-14A5-4878-A63D-128467830293 |
add | string | TRON address of the number of energies to buy | TX8BF429hr7qK1Te8UWLxD9xbumtX11111 |
status | int | 0 pause 1 on | 1 |
Response
{
"code": 200,
"message": "开启成功"
}
Parameters | Type | Description | Example |
---|---|---|---|
code | int | 200 succeeded, and the others were edit failures | 200/500 |
message | string | Tips | Pause Successful/Activate Successful |
代码示例
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject;
public class PostJsonRequest {
public static void main(String[] args) throws Exception {
URL url = new URL("https://web.apitrx.com/edit");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JSONObject json = new JSONObject();
json.put("apikey", "83928AFB-14A5-4878-A63D-128467830293");
json.put("add", "TX8BF429hr7qK1Te8UWLxD9xbumtX11111");
json.put("status", 1);
try (OutputStream os = conn.getOutputStream()) {
os.write(json.toString().getBytes("utf-8"));
}
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) sb.append(line);
JSONObject res = new JSONObject(sb.toString());
System.out.println("Code: " + res.getInt("code"));
System.out.println("Message: " + res.getString("message"));
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://web.apitrx.com/edit"
payload := map[string]interface{
"apikey": "83928AFB-14A5-4878-A63D-128467830293",
"add": "TX8BF429hr7qK1Te8UWLxD9xbumtX11111",
"status": 1,
}
jsonData, _ := json.Marshal(payload)
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var res struct {
Code int64 `json:"code"`
Message string `json:"message"`
}
json.Unmarshal(body, &res)
fmt.Println("Code:", res.Code)
fmt.Println("Message:", res.Message)
}
import requests
url = "https://web.apitrx.com/edit"
payload = {
"apikey": "83928AFB-14A5-4878-A63D-128467830293",
"add": "TX8BF429hr7qK1Te8UWLxD9xbumtX11111",
"status": 1
}
response = requests.post(url, json=payload)
res = response.json()
data = res["data"]
print("Code:", res["code"])
print("Message:", res["message"])
<?php
$url = "https://web.apitrx.com/edit";
$data = [
"apikey" => "83928AFB-14A5-4878-A63D-128467830293",
"add" => "TX8BF429hr7qK1Te8UWLxD9xbumtX11111",
"status" => 1
];
$options = [
"http" => [
"header" => "Content-Type: application/json\r\n",
"method" => "POST",
"content" => json_encode($data)
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response, true);
echo "Code: " . $result["code"] . "\n";
echo "Message: " . $result["message"] . "\n";
?>
curl -s -X POST https://web.apitrx.com/edit \
-H "Content-Type: application/json" \
-d '{"apikey":"83928AFB-14A5-4878-A63D-128467830293","add":"TX8BF429hr7qK1Te8UWLxD9xbumtX11111","status":1}'