POST
v2.2.0stable

Batch Add Devices

Batch register multiple UDIDs with flexible defaults and per-item overrides. Each item can use instant or reservation mode.

POST/api/adddevice/batch
Auth:API Key
Granica:10/minute

Parametry żądania

Wszystkie parametry mogą być przekazywane za pośrednictwem zapytania lub ciała

ParametrRodzajWymaganeOpis
token
stringOpcjonalnie
Global user API token. Used when item/defaults does not provide token
Przykład: your_api_token_here
mode
stringOpcjonalnie
Global add mode: instant or review. Default is instant; can be overridden by defaults.mode or item.mode
instantreview
Przykład: instant
defaults
objectOpcjonalnie
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
arrayOpcjonalnie
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
arrayOpcjonalnie
Simplified UDID array. Uses defaults/global params for all devices
Przykład: ["00008030-001234567890ABCD","00008020-00ABCDEF12345678"]
udids_text
stringOpcjonalnie
Text UDID list separated by comma, semicolon, whitespace, or new lines
Przykład: 00008030-001234567890ABCD 00008020-00ABCDEF12345678
continue_on_error
booleanOpcjonalnie
Whether to continue after an item fails. Default true
Przykład: true

Odpowiedź

ParametrRodzajWymaganeOpis
code
numberWymagane
Status code: 1=batch request processed
Przykład: 1
data.total
numberWymagane
Total requested devices
Przykład: 2
data.processed
numberWymagane
Actually processed item count
Przykład: 2
data.success
numberWymagane
Success count
Przykład: 1
data.failed
numberWymagane
Failure count
Przykład: 1
data.results
arrayWymagane
Per-item results with index/udid/mode/success/code/msg/data/raw
Przykład:
Przykład odpowiedzi
{
"code":1,
"msg":"Batch request processed",
"time":1769675945,
"data":
{
"total":2,
"processed":2,
"success":1,
"failed":1,
"continueOnError":true,
"results":
[
{
"index":0,
"udid":"00008030-001234567890ABCD",
"mode":"instant",
"success":true,
"code":1,
"msg":"添加成功",
"http_status":200,
"data":
{
"id":"AB12CD34",
"pool":0,
"addtime":1706500000,
"mobileprovision":"MIIPhgYJKoZIhvcNAQcCoII...(Base64)",
"p12":"MIINDgIBAzCCDMsGCSqGSIb3DQEHAa...(Base64)"
}
}
,
{
"index":1,
"udid":"invalid-udid",
"mode":"review",
"success":false,
"code":0,
"msg":"UDID格式错误",
"http_status":200
}
]
}
}

Kod błędu

Kod błędu3 zdefiniowane
0
Invalid JSON body
Request body is not valid JSON
0
items or udids is required
No device provided
0
Too many items, maximum is 50
Maximum 50 devices per batch

Ję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.

Zalecany nagłówek
X-Lang: pl
Obsługiwane języki
zh, en, zh-TW, vi, ar, es, ru

Obsł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.

POSThttps://testypro.iwai.cc/api/adddevice/batchZamknięte na tej stronie
string

Global user API token. Used when item/defaults does not provide token

string

Global add mode: instant or review. Default is instant; can be overridden by defaults.mode or item.mode

object

Default params for all items. Supports single add API params such as warranty/shtype/type/deviceType/beizhu/code/token/mode

array

Device item array. Each item requires udid and can override any defaults field. Provide at least one of items/udids/udids_text

array

Simplified UDID array. Uses defaults/global params for all devices

string

Text UDID list separated by comma, semicolon, whitespace, or new lines

boolean

Whether to continue after an item fails. Default true