# Web Cloud › OverTheBox › Device API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/overthebox/device.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/overthebox/device.json?format=openapi3

## Operations

- `POST /overTheBox/devices` — List the devices available for registration
- `GET /overTheBox/{serviceName}/device` — Get the device of an OverTheBox service
- `DELETE /overTheBox/{serviceName}/device` — Unlink the device of an OverTheBox service
- `GET /overTheBox/{serviceName}/device/hardware` — Get an OverTheBox hardware
- `POST /overTheBox/{serviceName}/device/logs` — Generate a temporary URL for the device logs

## List the devices available for registration

`POST /1.0/overTheBox/devices`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/#post-overthebox-devices

**Status:** Stable production version  
**IAM actions:** `account:apiovh:overTheBox/devices/create`

List the devices available for registration. Returns the devices seen from the IP address of the call, with their ID, last seen date and whether each one is already activated.

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.DeviceForRegistration[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activated` | boolean |  | Whether or not this device is actived |
| `deviceId` | string |  |  |
| `lastSeen` | string (date-time) |  | The last time this device was seen on the provisionning servers |

```json
[
  {
    "activated": true,
    "deviceId": "string",
    "lastSeen": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/devices" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/overTheBox/devices")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/overTheBox/devices");

print_r($result);
?>
```

## Get the device of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/device`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/#get-overthebox-servicename-device

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/get`

Get the device of an OverTheBox service. Returns the device ID, version, system information, public IP, network interfaces, last seen date and whether an update is available.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.Device | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activated` | boolean | read-only | Whether or not this device is associated to a service |
| `availableUpdate` | boolean | read-only | Whether or not an upate is available for this device |
| `deviceId` | string | read-only | The id of the device |
| `lastSeen` | string (date-time) | read-only | Last time the device has been seen on the provisionning servers |
| `networkInterfaces` | overTheBox.DeviceInterface[] | read-only | Network interfaces of the device |
| `networkInterfaces[].device` | string |  | Device of the interface |
| `networkInterfaces[].dnsServers` | ip[] |  | The DNS servers of this interface |
| `networkInterfaces[].gateway` | ip |  | Gateway of the interface |
| `networkInterfaces[].ip` | ip |  | IP of the interface |
| `networkInterfaces[].multipathStatus` | overTheBox.MultipathStatusEnum |  | Status of MPTCP on this interface — one of `backup`, `handover`, `master`, `off`, `on` |
| `networkInterfaces[].name` | string |  | Name of the interface |
| `networkInterfaces[].netmask` | ip |  | Netmask of the interface |
| `networkInterfaces[].publicIp` | ip |  | Public IP of the interface |
| `publicIp` | ip | read-only | The public IP of the device |
| `system` | overTheBox.DeviceSystem | read-only | Device system information |
| `system.cpu` | string |  | Device CPU |
| `system.hostname` | string |  | Device hostname |
| `system.kernel` | string |  | Device linux kernel version |
| `system.mac` | string |  | Device mac address (first interface mac) |
| `system.model` | string |  | Device model |
| `system.name` | string |  | Name of the device board |
| `system.offerName` | string |  | OVH offer name of the device board |
| `system.ovhName` | string |  | OVH name of the device board |
| `systemVersion` | string | read-only | System version of the device |
| `version` | string | read-only | Version of the device |

```json
{
  "activated": true,
  "availableUpdate": true,
  "deviceId": "string",
  "lastSeen": "2024-01-01T12:00:00Z",
  "networkInterfaces": [
    {
      "device": "string",
      "dnsServers": [
        "192.0.2.0"
      ],
      "gateway": "192.0.2.0",
      "ip": "192.0.2.0",
      "multipathStatus": "backup",
      "name": "string",
      "netmask": "192.0.2.0",
      "publicIp": "192.0.2.0"
    }
  ],
  "publicIp": "192.0.2.0",
  "system": {
    "cpu": "string",
    "hostname": "string",
    "kernel": "string",
    "mac": "string",
    "model": "string",
    "name": "string",
    "offerName": "string",
    "ovhName": "string"
  },
  "systemVersion": "string",
  "version": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/overTheBox/{serviceName}/device")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/overTheBox/{serviceName}/device");

print_r($result);
?>
```

## Unlink the device of an OverTheBox service

`DELETE /1.0/overTheBox/{serviceName}/device`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/#delete-overthebox-servicename-device

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/delete`

Unlink the device of an OverTheBox service. Removes the association between the device and the service. Link another device with linkDevice.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/overTheBox/{serviceName}/device")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/overTheBox/{serviceName}/device");

print_r($result);
?>
```

## Get an OverTheBox hardware

`GET /1.0/overTheBox/{serviceName}/device/hardware`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/#get-overthebox-servicename-device-hardware

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/hardware/get`

Get an OverTheBox hardware. Returns the name, model, serial and MAC address of a hardware, and whether it can be linked to a service without a device ID.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.Hardware | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canBeLinkedToService` | boolean | read-only | True if hardware can be linked to a service without deviceID |
| `mac` | macAddress | read-only | Hardware MAC address |
| `model` | string | read-only | Hardware model |
| `name` | string | read-only | Hardware name |
| `prettyModelName` | string | read-only | The hardware pretty model name |
| `serial` | string | read-only | Hardware serial |

```json
{
  "canBeLinkedToService": true,
  "mac": "00:00:5e:00:53:01",
  "model": "string",
  "name": "string",
  "prettyModelName": "string",
  "serial": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/hardware" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/overTheBox/{serviceName}/device/hardware")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/overTheBox/{serviceName}/device/hardware");

print_r($result);
?>
```

## Generate a temporary URL for the device logs

`POST /1.0/overTheBox/{serviceName}/device/logs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/#post-overthebox-servicename-device-logs

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/logs/create`

Generate a temporary URL for the device logs. Returns a temporary URL to download the logs of the OverTheBox device, with its expiration date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.TemporaryLogsLink | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expirationDate` | string (date-time) |  | Temporary url expiration date |
| `url` | string |  | Temporary url |

```json
{
  "expirationDate": "2024-01-01T12:00:00Z",
  "url": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/logs" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/overTheBox/{serviceName}/device/logs")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/overTheBox/{serviceName}/device/logs");

print_r($result);
?>
```
