POST /apiv2/address/rotate
Bir yatırma adresi rotasyonu talep edin. Mevcut yatırma adresi yenisiyle değiştirilecektir. İstek bir işlem kuyruğuna alınır ve 5 dakika içinde otomatik olarak tamamlanır.
Uç Nokta URL'si
POST https://netts.io/apiv2/address/rotateİstek Başlıkları
| Başlık | Gerekli | Açıklama |
|---|---|---|
| Content-Type | Evet | application/json |
| X-API-KEY | Evet | Netts panelinizden alınan API anahtarınız |
| X-Real-IP | Evet | Beyaz listenizdeki IP adresi |
İstek Gövdesi
json
{
"user_id": 1234,
"address_type": "web"
}Parametreler
| Parametre | Tür | Gerekli | Varsayılan | Açıklama |
|---|---|---|---|---|
| user_id | integer | Hayır | Kimliği doğrulanmış kullanıcı | Hedef kullanıcı kimliği. Kendi adresinizi rotasyona tabi tutmak için boş bırakın. Üst kullanıcılar SUB kullanıcılarının kimliğini belirtebilir |
| address_type | string | Hayır | "web" | Rotasyona tabi tutulacak adres türü: web veya tg |
Kimlik Doğrulama ve Yetkilendirme
Bu uç nokta hem kimlik doğrulama hem de yetkilendirme gerektirir:
- Kimlik Doğrulama: Geçerli API anahtarı + beyaz listeden IP (diğer uç noktalarla aynı)
- Yetkilendirme:
- Kendi adresinizi rotasyona tabi tutma — her zaman izin verilir
- SUB kullanıcınızın adresini rotasyona tabi tutma — üst kullanıcılar için izin verilir
- Başka bir kullanıcının adresini rotasyona tabi tutma —
403 Forbiddenile reddedilir
Örnek İstekler
cURL
bash
# Kendi adresini rotasyona tabi tut
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
# SUB kullanıcısının adresini rotasyona tabi tut (yalnızca üst kullanıcı)
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"
}
# Kendi adresini rotasyona tabi tut
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;
}
// Kendi adresini rotasyona tabi tut
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";
?>Yanıt
Başarılı Yanıt (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"
}Yanıt Alanları
| Alan | Tür | Açıklama |
|---|---|---|
| rotation_id | integer | Benzersiz rotasyon isteği kimliği (durum kontrolleri için kullanın) |
| user_id | integer | Adresi rotasyona tabi tutulan kullanıcı |
| address_type | string | Rotasyona tabi tutulan adres türü (web veya tg) |
| old_address | string | Rotasyon öncesindeki mevcut TRON yatırma adresi |
| status | string | İstek durumu: pending |
| message | string | İnsan tarafından okunabilir durum mesajı |
| estimated_completion | string | ISO 8601 formatında tahmini tamamlanma zamanı |
Rotasyon Durumunu Kontrol Et
GET /apiv2/address/rotate/status/
Daha önce gönderilmiş bir rotasyon isteğinin durumunu kontrol edin.
bash
curl https://netts.io/apiv2/address/rotate/status/42 \
-H "X-API-KEY: your_api_key" \
-H "X-Real-IP: your_whitelisted_ip"Yanıt:
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"
}Durum Değerleri
| Durum | Açıklama |
|---|---|
pending | İstek gönderildi, işlenmeyi bekliyor |
processing | Şu anda işleniyor |
completed | Yeni adres başarıyla atandı |
failed | Rotasyon sırasında hata oluştu |
Bekleyen Rotasyonu Kontrol Et
GET /apiv2/address/rotate/pending
Bir kullanıcının bekleyen bir rotasyon isteği olup olmadığını kontrol edin (rotasyon butonunu devre dışı bırakmak için kullanışlıdır).
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"Yanıt:
json
{
"user_id": 1234,
"address_type": "web",
"has_pending": true,
"pending_rotation": {
"rotation_id": 42,
"status": "pending",
"created_at": "2026-03-14T12:30:00Z"
}
}Önemli Notlar
Adres Değişikliği
Rotasyon tamamlandıktan sonra, mevcut yatırma adresiniz artık yatırma işlemlerini kabul etmeyecektir. Şunları yaptığınızdan emin olun:
- Rotasyon talebinde bulunmadan önce mevcut adresteki kalan bakiyeyi çekin
- Eski yatırma adresinize başvuran tüm harici sistemleri güncelleyin
- Gelecekteki tüm yatırma işlemleri için yeni adresi kullanın
İşlem Süresi
Rotasyon istekleri otomatik olarak işlenir. Yeni bir adres genellikle gönderimden sonraki 5 dakika içinde atanır.
- 7 günlük bir pencere içinde kullanıcı başına adres türü bazında yalnızca bir bekleyen rotasyona izin verilir
- Halihazırda bekleyen bir rotasyonunuz varsa istek
409 Conflictile reddedilecektir - Hem
webhem detgadresleri birbirinden bağımsız olarak rotasyona tabi tutulabilir - Üst kullanıcılar
user_idparametresini belirterek SUB kullanıcılarının adreslerini rotasyona tabi tutabilir
Hata Yanıtları
Çakışma (409)
json
{
"detail": "User 1234 already has a pending web address rotation request"
}Geçersiz İstek (400)
json
{
"detail": "User 1234 has no web deposit address"
}json
{
"detail": "address_type must be 'web' or 'tg'"
}Bulunamadı (404)
json
{
"detail": "User 9999 not found"
}Yetkisiz (403)
json
{
"detail": "Not authorized to rotate this user's address"
}Kimlik Doğrulama Hatası (401)
json
{
"detail": "X-API-KEY header required"
}Hata Kodu Referansı
| HTTP Durumu | Açıklama |
|---|---|
200 | Rotasyon isteği başarıyla gönderildi |
400 | Geçersiz istek (adres yok, geçersiz tür) |
401 | Eksik API anahtarı başlığı |
403 | Yetkisiz / Geçersiz API anahtarı veya IP |
404 | Kullanıcı bulunamadı / Rotasyon bulunamadı |
409 | Bekleyen rotasyon zaten mevcut |
500 | Dahili sunucu hatası |
İlgili Uç Noktalar
- POST /apiv2/subusergen — Yeni bir SUB kullanıcısı oluşturun
- DELETE /apiv2/subuserdel — Bir SUB kullanıcısını silin
- GET /apiv2/userinfo — Kullanıcı bilgilerini alın