Batch Add Devices
Batch register multiple UDIDs with flexible defaults and per-item overrides. Each item can use instant or reservation mode.
/api/adddevice/batchParametry żądania
Wszystkie parametry mogą być przekazywane za pośrednictwem zapytania lub ciała
| Parametr | Rodzaj | Wymagane | Opis |
|---|---|---|---|
token | string | Opcjonalnie | Global user API token. Used when item/defaults does not provide token Przykład: your_api_token_here |
mode | string | Opcjonalnie | Global add mode: instant or review. Default is instant; can be overridden by defaults.mode or item.mode instantreview Przykład: instant |
defaults | object | Opcjonalnie | Default params for all items. Supports single add API params such as warranty/shtype/type/deviceType/beizhu/code/token/mode Przykład: {"warranty":"1","type":"0","deviceType":"iphone","beizhu":"batch"} |
items | array | Opcjonalnie | Device item array. Each item requires udid and can override any defaults field. Provide at least one of items/udids/udids_text Przykład: [{"udid":"00008030-001234567890ABCD"},{"udid":"00008020-00ABCDEF12345678","mode":"review","warranty":"2","beizhu":"VIP device"}] |
udids | array | Opcjonalnie | Simplified UDID array. Uses defaults/global params for all devices Przykład: ["00008030-001234567890ABCD","00008020-00ABCDEF12345678"] |
udids_text | string | Opcjonalnie | Text UDID list separated by comma, semicolon, whitespace, or new lines Przykład: 00008030-001234567890ABCD
00008020-00ABCDEF12345678 |
continue_on_error | boolean | Opcjonalnie | Whether to continue after an item fails. Default true Przykład: true |
Odpowiedź
| Parametr | Rodzaj | Wymagane | Opis |
|---|---|---|---|
code | number | Wymagane | Status code: 1=batch request processed Przykład: 1 |
data.total | number | Wymagane | Total requested devices Przykład: 2 |
data.processed | number | Wymagane | Actually processed item count Przykład: 2 |
data.success | number | Wymagane | Success count Przykład: 1 |
data.failed | number | Wymagane | Failure count Przykład: 1 |
data.results | array | Wymagane | Per-item results with index/udid/mode/success/code/msg/data/raw Przykład: |
Kod błędu
000Język odpowiedzi
Dostosuj język odpowiedzi API do nagłówka X- Lang. Poniższe przykłady kodów automatycznie korzystają z aktualnego języka strony.
X-Lang: plzh, en, zh-TW, vi, ar, es, ruObsługiwane jest również Accept- Language; X- Lang ma pierwszeństwo. Nieobsługiwane języki podążają za zapasami języka strony.
Przykłady kodów
curl -X POST "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/adddevice/batch" \
-H "X-Lang: pl" \
-H "Content-Type: application/json" \
-d '{
"token": "your_api_token_here",
"mode": "instant",
"defaults": {
"warranty": "1",
"type": "0",
"deviceType": "iphone",
"beizhu": "batch"
},
"items": [
{
"udid": "00008030-001234567890ABCD"
},
{
"udid": "00008020-00ABCDEF12345678",
"mode": "review",
"warranty": "2",
"beizhu": "VIP device"
}
],
"udids": [
"00008030-001234567890ABCD",
"00008020-00ABCDEF12345678"
],
"udids_text": "00008030-001234567890ABCD\n00008020-00ABCDEF12345678",
"continue_on_error": true
}'Uwagi
- 该接口复用 /api/adddevice 和 /api/addyydevice 的原有业务逻辑,逐条处理,逐条扣款/退款/复用证书
- 请求体必须是 JSON;单条设备参数会转换为表单参数后调用原接口逻辑
- defaults 提供公共参数,items 中同名字段优先级更高
- mode 支持 instant/review;也兼容 reservation/reserve/yy/addyydevice 作为 review
- 单次最多 50 条,接口本身限流 10 次/分钟
Spróbuj w konsoli
Wypełnij poniższe parametry i wyślij wniosek o przetestowanie. Żądania są kierowane tylko do API tej witryny; adres URL jest zablokowany i nie może być zmieniony, a obecne pliki cookie logowania są włączone.
https://testypro.iwai.cc/api/adddevice/batchZamknięte na tej stronieGlobal user API token. Used when item/defaults does not provide token
Global add mode: instant or review. Default is instant; can be overridden by defaults.mode or item.mode
Default params for all items. Supports single add API params such as warranty/shtype/type/deviceType/beizhu/code/token/mode
Device item array. Each item requires udid and can override any defaults field. Provide at least one of items/udids/udids_text
Simplified UDID array. Uses defaults/global params for all devices
Text UDID list separated by comma, semicolon, whitespace, or new lines
Whether to continue after an item fails. Default true