更新玩家限紅
curl --request PUT \
--url https://api.example.com/api/v1/dt/user/limit \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f",
"platform_id": "AXTES",
"username": "player001",
"limit_id": "1",
"type": "2",
"key": "abc123hash"
}
'import requests
url = "https://api.example.com/api/v1/dt/user/limit"
payload = {
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f",
"platform_id": "AXTES",
"username": "player001",
"limit_id": "1",
"type": "2",
"key": "abc123hash"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
uuid: '3f1e16c7-4083-4897-b40b-55b7f674f72f',
platform_id: 'AXTES',
username: 'player001',
limit_id: '1',
type: '2',
key: 'abc123hash'
})
};
fetch('https://api.example.com/api/v1/dt/user/limit', 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.example.com/api/v1/dt/user/limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => '3f1e16c7-4083-4897-b40b-55b7f674f72f',
'platform_id' => 'AXTES',
'username' => 'player001',
'limit_id' => '1',
'type' => '2',
'key' => 'abc123hash'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/dt/user/limit"
payload := strings.NewReader("{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/v1/dt/user/limit")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dt/user/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 0,
"msg": "Success",
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f"
}
}{
"error": {
"code": 2,
"msg": "request hash signature(0FACF22B9E3DB5CDC670A0F7A65BB76A) is error",
"uuid": "9e96610f-5388-42df-b3ed-ba1b3178c63b"
}
}User API
更新玩家限紅
更新玩家的限紅設定
PUT
/
api
/
v1
/
dt
/
user
/
limit
更新玩家限紅
curl --request PUT \
--url https://api.example.com/api/v1/dt/user/limit \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f",
"platform_id": "AXTES",
"username": "player001",
"limit_id": "1",
"type": "2",
"key": "abc123hash"
}
'import requests
url = "https://api.example.com/api/v1/dt/user/limit"
payload = {
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f",
"platform_id": "AXTES",
"username": "player001",
"limit_id": "1",
"type": "2",
"key": "abc123hash"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
uuid: '3f1e16c7-4083-4897-b40b-55b7f674f72f',
platform_id: 'AXTES',
username: 'player001',
limit_id: '1',
type: '2',
key: 'abc123hash'
})
};
fetch('https://api.example.com/api/v1/dt/user/limit', 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.example.com/api/v1/dt/user/limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => '3f1e16c7-4083-4897-b40b-55b7f674f72f',
'platform_id' => 'AXTES',
'username' => 'player001',
'limit_id' => '1',
'type' => '2',
'key' => 'abc123hash'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/dt/user/limit"
payload := strings.NewReader("{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/v1/dt/user/limit")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dt/user/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"3f1e16c7-4083-4897-b40b-55b7f674f72f\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"limit_id\": \"1\",\n \"type\": \"2\",\n \"key\": \"abc123hash\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 0,
"msg": "Success",
"uuid": "3f1e16c7-4083-4897-b40b-55b7f674f72f"
}
}{
"error": {
"code": 2,
"msg": "request hash signature(0FACF22B9E3DB5CDC670A0F7A65BB76A) is error",
"uuid": "9e96610f-5388-42df-b3ed-ba1b3178c63b"
}
}此 API 可能返回的錯誤代碼
此 API 可能返回的錯誤代碼
| 代碼 | 說明 |
|---|---|
| 0 | 成功 |
| 2 | 無效參數 |
| 4 | 客戶不存在 |
| 19 | 請求次數已達上限 |
| 20 | Secret key 錯誤 |
| 25 | 類型參數錯誤 |
| 36 | 伺服器錯誤 |
| 41 | 上級代理未持有該限紅組合 |
| 42 | 請求頻率太高 |
| 9999 | 未知錯誤 |
主體
application/json
回應
成功
Show child attributes
Show child attributes
⌘I