用户
获取入口节点
GET
/me
获取有关主用户和子用户计数的可用流量的信息。
請求範例:
curl -X GET https://resi-api.iproyal.com/v1/me \
-H "Authorization: Bearer <your_api_token>"
<?php
$api_token = '<your_api_token>';
$url = 'https://resi-api.iproyal.com/v1/me';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
$headers = [
"Authorization: Bearer $api_token"
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>
import requests
api_token = '<your_api_token>'
url = 'https://resi-api.iproyal.com/v1/me'
headers = {
'Authorization': f'Bearer {api_token}'
}
response = requests.get(url, headers=headers)
print(response.text)
const https = require('https');
const apiToken = '<your_api_token>';
const url = 'https://resi-api.iproyal.com/v1/me';
const options = {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiToken}`
}
};
const req = https.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
console.log(data);
});
});
req.on('error', (error) => {
console.error('Error:', error.message);
});
req.end();
响应示例:
{
"available_traffic": 32.6,
"subusers_count": 13
}
Last updated