# device app bindings — NCM API

Binds a device app to a group, which is how an app reaches the routers in that group. List bindings, create one to roll an app out, or delete it to withdraw it; there is no update, so changing a binding means replacing it. See device apps for the apps themselves and device app states for rollout progress.

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

### GET /device_app_bindings/

Get information about device_app_bindings

Use the GET method on this endpoint to retrieve device_app_bindings records. Use the available filtering fields to narrow or broaden your search.

| 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> |
| account | query | in: int<br />out: url | no | Account that owns the object |
| account__in | query | in: int<br />out: url | no | Filter for account contains - a comma-separated list of account IDs |
| group | query | in: int<br />out: url | no | Group that owns the object |
| group__in | query | in: int<br />out: url | no | Filter for group contains - a comma-separated list of group IDs |
| app_version | query | in: int<br />out: url | no | Device app version |
| app_version__in | query | in: int<br />out: url | no | Filter for app_version contains - a comma-separated list of app version IDs |
| id | query | integer | no | ID of the device_app_bindings record |
| id__in | query | integer | no | Filter for ID contains - a comma-separated list of account IDs |
| state | query | string | no | Object state |
| state__in | query | string | no | Filter for states contains - a comma-separated list of states |
| expand | query | string | no | Specifies that the returned value for the passed in attribute be expanded in the response body |
| limit | query | integer | no | Restricts the number of records returned in a recordset to this value. Max value is 500. |
| offset | query | integer | no | Specifies where (an index) in a recordset to begin returning records. |

**Example request**

```bash
curl "https://www.cradlepointecm.com/api/v2/device_app_bindings/" \
  -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
{
  "data": [
    {
      "account": "https://www.cradlepointecm.com/api/v2/accounts/<account number>/",
      "app_version": "https://www.cradlepointecm.com/api/v2/device_app_versions/8615/",
      "created_at": "2021-02-12T17:49:30.656191+00:00",
      "group": "https://www.cradlepointecm.com/api/v2/groups/216763/",
      "id": "12526",
      "resource_url": "https://www.cradlepointecm.com/api/v2/device_app_bindings/12526/",
      "state": "installing",
      "updated_at": "2021-02-12T17:49:30.710742+00:00"
    }
  ],
  "meta": {
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null
  }
}
```

### POST /device_app_bindings/

Create a device_app_bindings record

Use the POST method on this endpoint to create a new device_app_bindings record. Include the fields/values to add for the record in the 'Content' field as a JSON object.

| 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/device_app_bindings/" \
  -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/<account number>/",
  "app_version": "https://www.cradlepointecm.com/api/v2/device_app_versions/8521/",
  "created_at": "2021-04-09T17:02:03.299244+00:00",
  "group": "https://www.cradlepointecm.com/api/v2/groups/236090/",
  "id": "13990",
  "resource_url": "https://www.cradlepointecm.com/api/v2/device_app_bindings/",
  "state": "",
  "updated_at": "2021-04-09T17:02:03.299263+00:00"
}
```

### DELETE /device_app_bindings/{id}/

Delete an device_app_bindings record

<p>This method deletes the device app binding with associated id</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 device_app_binding record to delete |

**Example request**

```bash
curl -X DELETE "https://www.cradlepointecm.com/api/v2/device_app_bindings/{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
