# Obtener Dispositivo

Para obtener un dispositivo particular se debe realizar un GET como el que se muestra a continuación.

<mark style="color:blue;">`GET`</mark> `https://api.persat.com.ar/v1/devices/device_id`

#### Path Parameters

| Name                                         | Type   | Description                   |
| -------------------------------------------- | ------ | ----------------------------- |
| device\_id<mark style="color:red;">\*</mark> | Number | Identificador del dispositivo |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer API\_KEY |

{% tabs %}
{% tab title="200: OK La consulta se ejecutó con éxito" %}

```json
{
    "success": true,
    "data": {
        "id": 104,    
        "type": "VEHICLE",
        "serial_number": "3213213-ABCD....",
        "first_name": "Martin Gonzalez",
        "last_name": "LKL 987",
        "working_zones": [
            {
                "id": 2,
                "created": "2013-08-16T14:27:20.000Z",
                "name": " GBA Norte"
            }, { ... }
        ],
        "working_hours": {
            "monday": [],
            "tuesday": [
                {
                    "start": "05:05",
                    "end": "06:06"
                }
            ],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": [
                {
                    "start": "01:01",
                    "end": "02:02"
                }
            ]
        }
    }
}
```

{% endtab %}

{% tab title="404: Not Found No se encontro el dispositivo" %}

```json
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No existe un device con este id"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request device\_id no es un número" %}

```javascript
{
    "success": false,
    "error": {
        "status": 400,
        "type": "BAD_REQUEST",
        "userMessage": "'device_id' debe ser un número entero"
    }
}
```

{% endtab %}
{% endtabs %}

### Analizando la Respuesta

```json
{
    "success": true,
    "data": {
        "id": 104,    
        "type": "VEHICLE",
        "serial_number": "3213213-ABCD....",
        "first_name": "Martin Gonzalez",
        "last_name": "LKL 987",
        "working_zones": [
            {
                "id": 2,
                "created": "2013-08-16T14:27:20.000Z",
                "name": " GBA Norte"
            }, { ... }
        ],
        "working_hours": {
            "monday": [],
            "tuesday": [
                {
                    "start": "05:05",
                    "end": "06:06"
                }
            ],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": [
                {
                    "start": "01:01",
                    "end": "02:02"
                }
            ]
        }
    }
}
```

**id:** Identificador del Dispositivo.&#x20;

**first\_name:** Nombre

**last\_name:** Apellido

{% hint style="info" %}
**first\_name** y **last\_name** se pueden usar libremente y pueden identificar a un vehiculo, por ejemplo con su modelo y patente
{% endhint %}

**type:** Tipo de dispositivo. Puede ser "VEHICLE" o "CELLPHONE"

**serial\_number:** Identificador unico del dispositivo físico. Por ejemplo, los dispositivos de tipo VEHICLE, usan como identificador el número de serie del equipo de rastreo, mientras que los de tipo CELLPHONE usan el imei o el número de serie de la placa de video del teléfono.

{% hint style="danger" %}
El <mark style="color:red;">**serial\_number**</mark> es meramente informativo, bajo ninguna circunstancia debe ser utilizado como identificador
{% endhint %}

**working\_zones**. Array con las zonas de trabajo asignadas. Los campos se describen en [Obtener Zona](/entidades-basicas/zonas-de-trabajo/obtener-zona.md)

**working\_hours.** Objeto json que contiene en cada key el día de la semana. Cada día de la semana es un array con objetos { start: "HH:mm", end: "HH:mm }. Indicando inicio y fin de jornada laboral.

{% hint style="warning" %}
Es un array, ya que se contempla para un futuro permitir horarios partidos. Es decir jornadas laborales con descansos intermedios.

Si el array está vacío, significa que no es un dia laborable.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.persat.com.ar/entidades-basicas/dispositivos/obtener-dispositivo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
