Ubah rotasi daftar
POST
/account/api/v1/residential/lists/rotationKonfirmasikan operasi dengan sengaja
Operasi ini dapat mengubah catatan, saldo, atau pengaturan layanan. Baca cakupan dan catatan terlebih dahulu. Jika hasil tidak pasti, periksa operasi yang sama, jangan memulai yang baru.
Otorisasi
| Authorization | Bearer YOUR_ARNPROXY_API_KEY |
|---|---|
| Izin yang diperlukan | residential_management |
| Accept | application/json |
| Content-Type | application/json |
| Idempotency-Key | 16–100 huruf, angka, _ atau -. Simpan dan gunakan nilai yang sama untuk operasi yang sama. |
Parameter
| Nama | Tipe | Keterangan |
|---|---|---|
Idempotency-Key | string | 16–100 huruf/angka/_/-. Pertahankan nilai untuk operasi/status; jangan pakai lagi dengan isi berbeda. |
list_id | integer | ID catatan daftar koneksi ARNPROXY sendiri, bukan ID daftar penyedia. |
rotation_seconds | integer | -1–3600 detik bulat, mengikuti nilai rotasi daftar yang ada. |
expected_rotation_seconds | integer | Nilai saat ini dari pemeriksaan daftar, -1–3600. |
Isi permintaan
Ganti YOUR_/FROM_ dengan nilai katalog, kutipan harga, atau cakupan terkait. Persetujuan pada contoh tetap false; setujui operasi nyata secara sengaja.
{
"list_id": "YOUR_LIST_ID",
"rotation_seconds": 60,
"expected_rotation_seconds": "FROM_LIST_CHECK"
}Contoh permintaan
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
curl --silent --show-error --header @- \
--header 'Accept: application/json' \
--connect-timeout 10 --max-time 30 \
--header 'Idempotency-Key: YOUR_SAVED_OPERATION_KEY' \
--request POST --header 'Content-Type: application/json' \
--data-binary @request.json \
'https://www.arnproxy.com/account/api/v1/residential/lists/rotation'Contoh tidak dijalankan di halaman ini. Simpan kunci API dalam variabel lingkungan server, bukan URL atau kode browser. Siapkan request.json untuk contoh POST.
{"curl":"printf \u0027Authorization: Bearer %s\\n\u0027 \u0022$ARNPROXY_API_KEY\u0022 |\n curl --silent --show-error --header @- \\\n --header \u0027Accept: application\/json\u0027 \\\n --connect-timeout 10 --max-time 30 \\\n --header \u0027Idempotency-Key: YOUR_SAVED_OPERATION_KEY\u0027 \\\n --request POST --header \u0027Content-Type: application\/json\u0027 \\\n --data-binary @request.json \\\n \u0027https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0027","python":"import os, requests\n\nheaders = {\u0022Authorization\u0022: \u0022Bearer \u0022 + os.environ[\u0022ARNPROXY_API_KEY\u0022]}\nheaders[\u0022Idempotency-Key\u0022] = \u0022YOUR_SAVED_OPERATION_KEY\u0022\nimport json\nwith open(\u0022request.json\u0022, encoding=\u0022utf-8\u0022) as f:\n payload = json.load(f)\nresponse = requests.post(\n \u0022https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0022,\n headers=headers, json=payload,\n timeout=(10, 30), allow_redirects=False\n)\nprint(response.status_code, response.text)\n# No automatic write retry.","javascript":"const headers = { Authorization: `Bearer ${process.env.ARNPROXY_API_KEY}` };\nheaders[\u0027Idempotency-Key\u0027] = \u0027YOUR_SAVED_OPERATION_KEY\u0027;\nconst { readFile } = await import(\u0027node:fs\/promises\u0027);\nheaders[\u0027Content-Type\u0027] = \u0027application\/json\u0027;\nconst body = await readFile(\u0027request.json\u0027, \u0027utf8\u0027);\nconst response = await fetch(\u0022https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0022, {\n method: \u0027POST\u0027, headers, redirect: \u0027error\u0027,\n signal: AbortSignal.timeout(30000), body\n});\nconsole.log(response.status, await response.text());\n\/\/ A write timeout is ambiguous; query its saved operation.","php":"\u003C?php\n$headers = [\u0027Accept: application\/json\u0027,\n \u0027Authorization: Bearer \u0027.getenv(\u0027ARNPROXY_API_KEY\u0027)];\n$headers[] = \u0027Idempotency-Key: YOUR_SAVED_OPERATION_KEY\u0027;\n$headers[] = \u0027Content-Type: application\/json\u0027;\n$ch = curl_init(\u0027https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0027);\ncurl_setopt_array($ch, [\n CURLOPT_RETURNTRANSFER =\u003E true,\n CURLOPT_HTTPHEADER =\u003E $headers,\n CURLOPT_FOLLOWLOCATION =\u003E false,\n CURLOPT_SSL_VERIFYPEER =\u003E true, CURLOPT_SSL_VERIFYHOST =\u003E 2,\n CURLOPT_CONNECTTIMEOUT =\u003E 10, CURLOPT_TIMEOUT =\u003E 30,\n CURLOPT_POST =\u003E true,\n CURLOPT_POSTFIELDS =\u003E file_get_contents(\u0027request.json\u0027),\n]);\n$result = curl_exec($ch);\nif ($result === false) {\n \/\/ Do not repeat a write; use the original operation key.\n throw new RuntimeException(\u0027Transport result unknown\u0027);\n}\necho curl_getinfo($ch, CURLINFO_HTTP_CODE).PHP_EOL.$result;\ncurl_close($ch);","go":"package main\n\nimport (\n \u0022fmt\u0022\n \u0022io\u0022\n \u0022net\/http\u0022\n \u0022os\u0022\n \u0022time\u0022\n)\n\nfunc main() {\n client := \u0026http.Client{Timeout: 30*time.Second,\n CheckRedirect: func(req *http.Request, via []*http.Request) error {\n return http.ErrUseLastResponse\n }}\n var body io.Reader\n file, err := os.Open(\u0022request.json\u0022); if err != nil { panic(err) }\n defer file.Close(); body = file\n req, err := http.NewRequest(\u0022POST\u0022, \u0022https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0022, body)\n if err != nil { panic(err) }\n req.Header.Set(\u0022Authorization\u0022, \u0022Bearer \u0022+os.Getenv(\u0022ARNPROXY_API_KEY\u0022))\n req.Header.Set(\u0022Idempotency-Key\u0022, \u0022YOUR_SAVED_OPERATION_KEY\u0022)\n req.Header.Set(\u0022Content-Type\u0022, \u0022application\/json\u0022)\n res, err := client.Do(req); if err != nil { panic(err) }\n defer res.Body.Close()\n data, err := io.ReadAll(res.Body); if err != nil { panic(err) }\n fmt.Println(res.StatusCode, string(data))\n}","csharp":"using System;\nusing System.IO;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Text;\n\nusing var handler = new HttpClientHandler { AllowAutoRedirect = false };\nusing var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };\nusing var request = new HttpRequestMessage(HttpMethod.Post,\n \u0022https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0022);\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\n \u0022Bearer\u0022, Environment.GetEnvironmentVariable(\u0022ARNPROXY_API_KEY\u0022));\nrequest.Headers.Add(\u0022Idempotency-Key\u0022, \u0022YOUR_SAVED_OPERATION_KEY\u0022);\nrequest.Content = new StringContent(\n await File.ReadAllTextAsync(\u0022request.json\u0022), Encoding.UTF8, \u0022application\/json\u0022);\nusing var response = await client.SendAsync(request);\nConsole.WriteLine((int)response.StatusCode);\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\n\/\/ Never automatically retry an ambiguous write.","java":"import java.net.URI;\nimport java.net.http.*;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.*;\n\n\/\/ Inside your application method:\nvar client = HttpClient.newHttpClient();\nvar request = HttpRequest.newBuilder(URI.create(\u0022https:\/\/www.arnproxy.com\/account\/api\/v1\/residential\/lists\/rotation\u0022))\n .header(\u0022Authorization\u0022, \u0022Bearer \u0022 + System.getenv(\u0022ARNPROXY_API_KEY\u0022))\n .header(\u0022Accept\u0022, \u0022application\/json\u0022)\n .header(\u0022Idempotency-Key\u0022, System.getenv(\u0022ARNPROXY_OPERATION_KEY\u0022))\n .header(\u0022Content-Type\u0022, \u0022application\/json\u0022)\n .POST(HttpRequest.BodyPublishers.ofString(\n Files.readString(Path.of(\u0022request.json\u0022), StandardCharsets.UTF_8)))\n .build();\nvar response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.statusCode());"}Respons
200Respons berhasil
{
"ok": true,
"data": {
"state": "completed",
"list_id": 30001,
"action": "rotation",
"requested_value": 60,
"write_sent": true,
"reason": null,
"replayed": false,
"updated_at": 1893499200,
"next_action": null
},
"meta": {
"request_id": "000000000000000000000001",
"phase": "public_v1",
"source": "arnproxy_records"
}
}Kolom dan tipe respons
| Nama | Tipe | Keterangan |
|---|---|---|
ok | boolean | Penanda berhasil; jika false, periksa error.code. |
data | object | Hasil khusus operasi; contoh bersifat ilustratif dan sintetis. |
data.state | string | Status catatan/operasi. accepted bukan terkirim; completed bukan tes koneksi. |
data.list_id | integer | ID catatan ARNPROXY terkait; gunakan alih-alih ID internal penyedia. |
data.action | string | Nilai khusus operasi untuk action. Pertahankan tipe yang dikembalikan dan baca catatan perilaku. |
data.requested_value | integer | Nilai khusus operasi untuk requested value. Pertahankan tipe yang dikembalikan dan baca catatan perilaku. |
data.write_sent | boolean | Nilai khusus operasi untuk write sent. Pertahankan tipe yang dikembalikan dan baca catatan perilaku. |
data.reason | string|null | Kode alasan tetap atau null, bukan teks kesalahan penyedia mentah. |
data.replayed | boolean | Hasil tersimpan dari operasi sama, bukan bukti debit/tindakan baru. |
data.updated_at | integer | Detik Unix untuk pengaturan Residential; pertahankan representasi yang ditunjukkan untuk hasil lain. |
data.next_action | string|null | Nilai khusus operasi untuk next action. Pertahankan tipe yang dikembalikan dan baca catatan perilaku. |
meta | object | Metadata korelasi permintaan dan sumber data. |
meta.request_id | string | ID korelasi permintaan HTTP ini, bukan kunci operasi atau ID pesanan. |
meta.phase | string | Nilai khusus operasi untuk phase. Pertahankan tipe yang dikembalikan dan baca catatan perilaku. |
meta.source | string | Sumber data; catatan lokal dan kueri penyedia langsung merupakan bukti berbeda. |
Respons kesalahan
{
"ok": false,
"error": { "code": "INVALID_API_KEY" },
"meta": { "request_id": "000000000000000000000001" }
}Autentikasi dan validasi dapat menolak permintaan sebelum dijalankan. Lihat referensi kesalahan dan simpan request_id untuk dukungan. Jangan kirim kunci atau kata sandi. Kesalahan & batas →
Perilaku & catatan penting
- ID paket/daftar adalah catatan ARNPROXY, bukan kunci penyedia. Snapshot usang tidak memberi akses; gunakan residential_package_refresh bila perlu.
- Daftar baru mendukung login_password atau ip_auth. Daftar IP menerima 1–20 IPv4 publik unik. Menghapus daftar tidak menghapus paket GB; hanya koneksi daftar itu dicabut.
- Timeout/5xx bukan bukti perubahan gagal. Gunakan Idempotency-Key awal untuk status. Jangan ulang dengan kunci baru; GET tidak mengirim ulang perubahan.