# speed test — NCM API

Runs modem speed tests on demand. POST to start a test, GET by ID to collect the result, DELETE to clear it. Results are per-modem, so this is how you verify a link's throughput after a configuration or carrier change.

Base URL: https://www.cradlepointecm.com/api/v2

### GET /speed_test/{id}/

Get speed tests information

<p>Gets the results of a speed test job. The results are updated with the latest known state of the speed tests. </p><p>Example URL</p><pre> https://www.cradlepointecm.com/api/v2/speed_test/{id}/</pre>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| id | path | integer | yes | ID of the speed test |

**Example request**

```bash
curl "https://www.cradlepointecm.com/api/v2/speed_test/{id}/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — Example response.

```json
{
  "account": "https://www.cradlepointecm.com/api/v2/accounts/1/",
  "config": {
    "host": "YOURTESTSERVER.COM",
    "max_test_concurrency": 5,
    "net_device_ids": [
      12345678
    ],
    "port": 12865,
    "size": null,
    "test_timeout": 10,
    "test_type": "TCP Download",
    "time": 10
  },
  "created_at": "2019-02-06T15:16:16.240612+00:00",
  "id": "47535",
  "progress": {
    "completed": 1,
    "total_count": 1
  },
  "resource_uri": "https://www.cradlepointecm.com/api/v2/speed_test/47535/",
  "results": [
    {
      "created_at": "2019-02-06 15:16:16.260749+00:00",
      "net_device_id": 12345678,
      "results": "TCP Download Test Timestamp: 2019-02-18 16:14:56 Duration: 10.01 Seconds Client Received: 69.6 MB Client Sent: 0 bytesServer Received: 0 bytes Server Sent: 70.4 MB Download Throughput: 58.34 Mbps",
      "router_id": 123456,
      "state": "success",
      "updated_at": "2019-02-06 15:16:19.573507+00:00"
    }
  ],
  "state": "complete",
  "updated_at": "2019-02-06T15:17:16.362784+00:00"
}
```

### DELETE /speed_test/{id}/

Deletes a speed test job.

<p>Deletes a speed test job.</p>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| id  | path | integer | yes | ID of the speed test |

**Example request**

```bash
curl -X DELETE "https://www.cradlepointecm.com/api/v2/speed_test/{id}/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — No response was specified

### POST /speed_test/

Creates a new speed test job

<p>Used to create and queue a speed test job. Once started the speed test job will queue as many individual speed tests as the system allows. When a speed test finishes more speed tests are started. This repeats until all the speed tests have completed.</p>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |

**Request body**

**Example request**

```bash
curl -X POST "https://www.cradlepointecm.com/api/v2/speed_test/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Response 200** — Example response.

```json
{
  "account": "https://www.cradlepointecm.com/api/v2/accounts/1/",
  "config": {
    "host": "YOURTESTSERVER.COM",
    "max_test_concurrency": 5,
    "net_device_ids": [
      12345678
    ],
    "port": 12865,
    "size": null,
    "test_timeout": 10,
    "test_type": "TCP Download",
    "time": 10
  },
  "created_at": "2019-02-06T15:16:16.240612+00:00",
  "id": "47535",
  "progress": null,
  "resource_uri": "https://www.cradlepointecm.com/api/v2/speed_test/47535/",
  "results": null,
  "state": "created",
  "updated_at": "2019-02-06T15:16:16.240636+00:00"
}
```
