# 测试设备 API

## createTestDevice

为应用程序注册测试设备。

`POST` `https://api.pushwoosh.com/json/1.3/createTestDevice`

#### 请求体

| 名称 | 类型 | 描述 |
| --- | --- | --- |
| application\* | string | [Pushwoosh 应用代码](/zh/developer/api-reference/api-identifiers/#application-code) |
| push\_token\* | string | 设备的 [Push token](/zh/developer/api-reference/api-identifiers/#push-token)。 |
| device\_type\* | integer | [设备类型](/zh/developer/api-reference/api-identifiers/#device-type)。查看 `/registerDevice` 方法中的可能值。 |
| name\* | string | 测试设备名称。 |
| description | string | 测试设备描述。 |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
```
</TabItem>
</Tabs>


```javascript title="Example"
{
  "request": {
    "application": "XXXXX-XXXXX",        // required. Pushwoosh application code
    "push_token": "DEVICE_PUSH_TOKEN",   // required.
    "device_type": 1,                    // required. Refer to /registerDevice for device types
    "name": "TEST_DEVICE_1",             // required. Test device name
    "description": "android test device" // optional. Test device description
  }
}
```

## listTestDevices

返回特定应用程序的所有测试设备。

`POST` `https://api.pushwoosh.com/json/1.3/listTestDevices`

#### 请求体

| 名称 | 类型 | 描述 |
| --- | --- | --- |
| auth\* | string | 来自 Pushwoosh 控制面板的 [API 访问令牌](/zh/developer/api-reference/api-identifiers/#api-access-token)。 |
| application\* | string | [Pushwoosh 应用代码](/zh/developer/api-reference/api-identifiers/#application-code) |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "TestDevices": [{
      "name": "iosDevice",
      "type": "1",
      "pushtoken": "token",
      "description": "ios device"
    }]
  }
}
```
</TabItem>
</Tabs>



```javascript title="Example"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX"    // required. Pushwoosh application code
  }
}
```

有关设备类型，请参阅 [`/registerDevice`](/zh/developer/api-reference/device-api/#registerdevice)。