控制用戶
curl --request PUT \
--url https://api.example.com/api/v1/dt/user/status \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "e69da788a6c841d4953c475fc42bf464",
"platform_id": "AXTES",
"username": "player001",
"type": "1",
"key": "abc123hash"
}
'import requests
url = "https://api.example.com/api/v1/dt/user/status"
payload = {
"uuid": "e69da788a6c841d4953c475fc42bf464",
"platform_id": "AXTES",
"username": "player001",
"type": "1",
"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: 'e69da788a6c841d4953c475fc42bf464',
platform_id: 'AXTES',
username: 'player001',
type: '1',
key: 'abc123hash'
})
};
fetch('https://api.example.com/api/v1/dt/user/status', 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/status",
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' => 'e69da788a6c841d4953c475fc42bf464',
'platform_id' => 'AXTES',
'username' => 'player001',
'type' => '1',
'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/status"
payload := strings.NewReader("{\n \"uuid\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\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/status")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\n \"key\": \"abc123hash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dt/user/status")
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\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\n \"key\": \"abc123hash\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 0,
"msg": "Success",
"uuid": "e69da788a6c841d4953c475fc42bf464"
}
}{
"error": {
"code": 2,
"msg": "request hash signature(0FACF22B9E3DB5CDC670A0F7A65BB76A) is error",
"uuid": "9e96610f-5388-42df-b3ed-ba1b3178c63b"
}
}Game API
控制用戶
控制用戶狀態(凍結/解凍/踢出)
PUT
/
api
/
v1
/
dt
/
user
/
status
控制用戶
curl --request PUT \
--url https://api.example.com/api/v1/dt/user/status \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "e69da788a6c841d4953c475fc42bf464",
"platform_id": "AXTES",
"username": "player001",
"type": "1",
"key": "abc123hash"
}
'import requests
url = "https://api.example.com/api/v1/dt/user/status"
payload = {
"uuid": "e69da788a6c841d4953c475fc42bf464",
"platform_id": "AXTES",
"username": "player001",
"type": "1",
"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: 'e69da788a6c841d4953c475fc42bf464',
platform_id: 'AXTES',
username: 'player001',
type: '1',
key: 'abc123hash'
})
};
fetch('https://api.example.com/api/v1/dt/user/status', 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/status",
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' => 'e69da788a6c841d4953c475fc42bf464',
'platform_id' => 'AXTES',
'username' => 'player001',
'type' => '1',
'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/status"
payload := strings.NewReader("{\n \"uuid\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\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/status")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\n \"key\": \"abc123hash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dt/user/status")
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\": \"e69da788a6c841d4953c475fc42bf464\",\n \"platform_id\": \"AXTES\",\n \"username\": \"player001\",\n \"type\": \"1\",\n \"key\": \"abc123hash\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 0,
"msg": "Success",
"uuid": "e69da788a6c841d4953c475fc42bf464"
}
}{
"error": {
"code": 2,
"msg": "request hash signature(0FACF22B9E3DB5CDC670A0F7A65BB76A) is error",
"uuid": "9e96610f-5388-42df-b3ed-ba1b3178c63b"
}
}此 API 可能返回的錯誤代碼
此 API 可能返回的錯誤代碼
| 代碼 | 說明 |
|---|---|
| 0 | 成功 |
| 2 | 無效參數 |
| 19 | 請求次數已達上限 |
| 20 | Secret key 錯誤 |
| 21 | 非法用戶名稱 |
| 25 | 類型參數錯誤 |
| 36 | 伺服器錯誤 |
| 9999 | 未知錯誤 |
⌘I