POST /apiv2/address/rotate
डिपॉजिट एड्रेस रोटेशन का अनुरोध करें। वर्तमान डिपॉजिट एड्रेस को एक नए एड्रेस से बदल दिया जाएगा। यह अनुरोध एक प्रोसेसिंग कतार में रखा जाता है और 5 मिनट के भीतर स्वचालित रूप से पूरा हो जाता है।
एंडपॉइंट URL
POST https://netts.io/apiv2/address/rotateअनुरोध हेडर
| हेडर | आवश्यक | विवरण |
|---|---|---|
| Content-Type | हाँ | application/json |
| X-API-KEY | हाँ | Netts डैशबोर्ड से आपकी API कुंजी |
| X-Real-IP | हाँ | आपकी व्हाइटलिस्ट से IP एड्रेस |
अनुरोध बॉडी
json
{
"user_id": 1234,
"address_type": "web"
}पैरामीटर
| पैरामीटर | प्रकार | आवश्यक | डिफ़ॉल्ट | विवरण |
|---|---|---|---|---|
| user_id | integer | नहीं | प्रमाणित उपयोगकर्ता | लक्षित उपयोगकर्ता ID। अपना स्वयं का एड्रेस रोटेट करने के लिए इसे छोड़ दें। पेरेंट उपयोगकर्ता अपने SUB-user की ID निर्दिष्ट कर सकते हैं |
| address_type | string | नहीं | "web" | रोटेट करने के लिए एड्रेस का प्रकार: web या tg |
प्रमाणीकरण और प्राधिकरण
इस एंडपॉइंट के लिए प्रमाणीकरण (authentication) और प्राधिकरण (authorization) दोनों की आवश्यकता होती है:
- प्रमाणीकरण: मान्य API कुंजी + व्हाइटलिस्ट से IP (अन्य एंडपॉइंट्स के समान)
- प्राधिकरण:
- अपना स्वयं का एड्रेस रोटेट करना — हमेशा अनुमत है
- अपने SUB-user का एड्रेस रोटेट करना — पेरेंट उपयोगकर्ताओं के लिए अनुमत है
- किसी अन्य उपयोगकर्ता का एड्रेस रोटेट करना —
403 Forbiddenके साथ अस्वीकार कर दिया जाएगा
उदाहरण अनुरोध
cURL
bash
# Rotate own address
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"address_type": "web"}'bash
# Rotate SUB-user's address (parent user only)
curl -X POST https://netts.io/apiv2/address/rotate \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip" \
-d '{"user_id": 1234, "address_type": "web"}'Python
python
import requests
url = "https://netts.io/apiv2/address/rotate"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "your_api_key",
"X-Real-IP": "your_whitelisted_ip"
}
# Rotate own address
response = requests.post(url, headers=headers, json={"address_type": "web"})
data = response.json()
if response.status_code == 200:
print(f"Rotation ID: {data['rotation_id']}")
print(f"Old Address: {data['old_address']}")
print(f"Status: {data['status']}")
print(f"Estimated Completion: {data['estimated_completion']}")
else:
print(f"Error: {data.get('detail', 'Unknown error')}")Node.js
javascript
const axios = require('axios');
async function rotateAddress(apiKey, whitelistedIp, addressType = 'web', userId = null) {
const url = 'https://netts.io/apiv2/address/rotate';
const body = { address_type: addressType };
if (userId) body.user_id = userId;
const response = await axios.post(url, body, {
headers: {
'Content-Type': 'application/json',
'X-API-KEY': apiKey,
'X-Real-IP': whitelistedIp
},
timeout: 30000
});
const data = response.data;
console.log(`Rotation ID: ${data.rotation_id}`);
console.log(`Status: ${data.status}`);
console.log(`Old Address: ${data.old_address}`);
return data;
}
// Rotate own address
rotateAddress('your_api_key', 'your_whitelisted_ip')
.then(result => console.log('Submitted:', result.message))
.catch(err => console.error('Error:', err.response?.data || err.message));PHP
php
<?php
$url = 'https://netts.io/apiv2/address/rotate';
$data = json_encode([
'address_type' => 'web'
]);
$options = [
'http' => [
'header' => implode("\r\n", [
"Content-Type: application/json",
"X-API-KEY: your_api_key",
"X-Real-IP: your_whitelisted_ip"
]),
'method' => 'POST',
'content' => $data,
'timeout' => 30
]
];
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response, true);
echo "Rotation ID: {$result['rotation_id']}\n";
echo "Old Address: {$result['old_address']}\n";
echo "Status: {$result['status']}\n";
echo "Message: {$result['message']}\n";
?>प्रतिक्रिया
सफल प्रतिक्रिया (200 OK)
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"old_address": "TCurrentAddress1234567890123456789",
"status": "pending",
"message": "Address rotation request submitted. New address will be assigned within 5 minutes.",
"estimated_completion": "2026-03-14T12:35:00Z"
}प्रतिक्रिया फ़ील्ड
| फ़ील्ड | प्रकार | विवरण |
|---|---|---|
| rotation_id | integer | विशिष्ट रोटेशन अनुरोध ID (स्थिति जांच के लिए उपयोग करें) |
| user_id | integer | वह उपयोगकर्ता जिसका एड्रेस रोटेट किया जा रहा है |
| address_type | string | रोटेट किया जा रहा एड्रेस प्रकार (web या tg) |
| old_address | string | रोटेशन से पहले का वर्तमान TRON डिपॉजिट एड्रेस |
| status | string | अनुरोध की स्थिति: pending |
| message | string | मानव-पठनीय स्थिति संदेश |
| estimated_completion | string | ISO 8601 प्रारूप में अनुमानित पूर्णता समय |
रोटेशन स्थिति की जाँच करें
GET /apiv2/address/rotate/status/
पहले सबमिट किए गए रोटेशन अनुरोध की स्थिति जांचें।
bash
curl https://netts.io/apiv2/address/rotate/status/42 \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"प्रतिक्रिया:
json
{
"rotation_id": 42,
"user_id": 1234,
"address_type": "web",
"status": "completed",
"old_address": "TOldAddress1234567890123456789012",
"new_address": "TNewAddress1234567890123456789012",
"created_at": "2026-03-14T12:30:00Z",
"completed_at": "2026-03-14T12:34:15Z"
}स्थिति मान
| स्थिति | विवरण |
|---|---|
pending | अनुरोध सबमिट कर दिया गया है, प्रोसेस होने की प्रतीक्षा कर रहा है |
processing | वर्तमान में प्रोसेस किया जा रहा है |
completed | नया एड्रेस सफलतापूर्वक असाइन कर दिया गया है |
failed | रोटेशन के दौरान त्रुटि हुई |
लंबित रोटेशन की जाँच करें
GET /apiv2/address/rotate/pending
जांचें कि क्या किसी उपयोगकर्ता का रोटेशन अनुरोध लंबित है (रोटेशन बटन को निष्क्रिय करने के लिए उपयोगी)।
bash
curl "https://netts.io/apiv2/address/rotate/pending?address_type=web" \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"प्रतिक्रिया:
json
{
"user_id": 1234,
"address_type": "web",
"has_pending": true,
"pending_rotation": {
"rotation_id": 42,
"status": "pending",
"created_at": "2026-03-14T12:30:00Z"
}
}महत्वपूर्ण नोट्स
एड्रेस परिवर्तन
रोटेशन पूरा होने के बाद, आपका वर्तमान डिपॉजिट एड्रेस अब डिपॉजिट स्वीकार नहीं करेगा। सुनिश्चित करें कि:
- रोटेशन का अनुरोध करने से पहले वर्तमान एड्रेस से किसी भी शेष बैलेंस को निकाल लें
- अपने पुराने डिपॉजिट एड्रेस को संदर्भित करने वाले किसी भी बाहरी सिस्टम को अपडेट करें
- भविष्य के सभी डिपॉजिट के लिए नए एड्रेस का उपयोग करें
प्रोसेसिंग समय
रोटेशन अनुरोध स्वचालित रूप से संसाधित किए जाते हैं। सबमिट करने के 5 मिनट के भीतर आमतौर पर एक नया एड्रेस असाइन कर दिया जाता है।
- 7 दिनों की विंडो के भीतर प्रति उपयोगकर्ता प्रति एड्रेस प्रकार केवल एक लंबित रोटेशन की अनुमति है
- यदि आपके पास पहले से ही एक लंबित रोटेशन है, तो अनुरोध
409 Conflictके साथ अस्वीकार कर दिया जाएगा webऔरtgदोनों एड्रेस को स्वतंत्र रूप से रोटेट किया जा सकता है- पेरेंट उपयोगकर्ता
user_idपैरामीटर निर्दिष्ट करके अपने SUB-users के एड्रेस रोटेट कर सकते हैं
त्रुटि प्रतिक्रियाएँ
कॉन्फ़्लिक्ट (409)
json
{
"detail": "User 1234 already has a pending web address rotation request"
}अमान्य अनुरोध (400)
json
{
"detail": "User 1234 has no web deposit address"
}json
{
"detail": "address_type must be 'web' or 'tg'"
}नहीं मिला (404)
json
{
"detail": "User 9999 not found"
}निषिद्ध (403)
json
{
"detail": "Not authorized to rotate this user's address"
}प्रमाणीकरण त्रुटि (401)
json
{
"detail": "X-API-KEY header required"
}त्रुटि कोड संदर्भ
| HTTP स्थिति | विवरण |
|---|---|
200 | रोटेशन अनुरोध सफलतापूर्वक सबमिट किया गया |
400 | अमान्य अनुरोध (कोई एड्रेस नहीं, अमान्य प्रकार) |
401 | अनुपलब्ध API कुंजी हेडर |
403 | अधिकृत नहीं / अमान्य API कुंजी या IP |
404 | उपयोगकर्ता नहीं मिला / रोटेशन नहीं मिला |
409 | लंबित रोटेशन पहले से मौजूद है |
500 | आंतरिक सर्वर त्रुटि |
संबंधित एंडपॉइंट्स
- POST /apiv2/subusergen — एक नया SUB-user बनाएं
- DELETE /apiv2/subuserdel — SUB-user हटाएं
- GET /apiv2/userinfo — उपयोगकर्ता की जानकारी प्राप्त करें