# Obtener elemento

Para obtener un elemento de una Master Db en Persat, se debe enviar un GET como el que se especifica a continuación.

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

#### Path Parameters

| Name                                       | Type   | Description                          |
| ------------------------------------------ | ------ | ------------------------------------ |
| mdb\_id<mark style="color:red;">\*</mark>  | Number | Identificador de la Master Db.       |
| field\_1<mark style="color:red;">\*</mark> | String | Identificador del elemento a obtener |

#### 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": {
        "mdb_id": 4,
        "fields": {
            "1": "DEST-123AALK",
            "2": "Destornillador perillero",
            "5": "Rojo",
            "6": "130.76"
        },
        "updated": "2022-05-20T13:07:34.000Z"
    }
}
```

{% endtab %}

{% tab title="404: Not Found El elemento no existe" %}

```json
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No existe el mdb_id: 2312323213"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Error en alguno de los campos enviados. userMessage contiene informacipon adicional." %}

```javascript
{
    "success": false,
    "error": {
        "status": 400,
        "type": "BAD_REQUEST",
        "userMessage": "'mdb_id' es un number (entero) obligatorio"
    }
}
```

{% endtab %}
{% endtabs %}

### Analizando la Respuesta

En caso que no haya ningun error, obtenemos

```json
{
    "success": true,
    "data": {
        "mdb_id": 4,
        "fields": {
            "1": "DEST-123AALK",
            "2": "Destornillador perillero",
            "5": "Rojo",
            "6": "130.76"
        },
        "updated": "2022-05-20T13:07:34.000Z"
    }
}
```

**mdb\_id:** Identificador de la Master Db, puedo tener varias dbs al mismo tiempo. Por ejemplo una de Productos y otra de Insumos.

**fields:** Objeto JSON que contiene las propiedades del elemento. Esas propiedades estan definidas en la Master Db. Serian como las columnas de la tabla. Por ejemplo el field "5" sería el color del producto.

{% hint style="info" %}
Para ver los identificadores de cada field [Identificación de las Master Dbs](/entidades-basicas/master-db.md#identificacion-de-las-master-dbs)
{% endhint %}

**updated:** Es la fecha de inserción o modificación en UTC


---

# 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/master-db/obtener-elemento.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.
