# Obtener estructura/esquema de una Master Db

Para obtener la estructura/esquema de una Master Db particular, 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/masterdbs/mdb_id`

#### Path Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| mdb\_id<mark style="color:red;">\*</mark> | Number | Identificador de la Master Db. |

#### 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": 133,
        "name": "Productos",
        "fields": [
            {
                "id": 1,
                "name": "Nro. de serie",
                "type": "TEXT"
            },
            {
                "id": 2,
                "name": "Descripcion",
                "type": "TEXT"
            },
            {
                "id": 5,
                "name": "Telefono",
                "type": "TELEPHONE"
            },
            {
                "id": 6,
                "name": "Link",
                "type": "LINK"
            },
            {
                "id": 7,
                "name": "precio",
                "type": "NUMBER"
            },
            {
                "id": 8,
                "name": "correo electronico",
                "type": "EMAIL"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="404: Not Found no existe la Master Db con ese identificador" %}

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### Analizando la Respuesta

En caso que no haya ningun error, obtenemos

```json
{
    "success": true,
    "data": {
        "mdb_id": 133,
        "name": "Productos",
        "fields": [
            {
                "id": 1,
                "name": "Nro. de serie",
                "type": "TEXT"
            },
            {
                "id": 2,
                "name": "Descripcion",
                "type": "TEXT"
            },
            {
                "id": 5,
                "name": "Telefono",
                "type": "TELEPHONE"
            },
            {
                "id": 6,
                "name": "Link",
                "type": "LINK"
            },
            {
                "id": 7,
                "name": "precio",
                "type": "NUMBER"
            },
            {
                "id": 8,
                "name": "correo electronico",
                "type": "EMAIL"
            }
        ]
    }
}
```

**mdb\_id:** Identificador de la Master Db

**name:** Nombre de la Master Db. Por ej: "Productos"

**fields:** Objeto JSON que describe la estructura de la Master Db. Esas propiedades serían como las columnas de la tabla. Por ejemplo el field "7" sería el precio del procuto.

{% hint style="info" %}
Los types disponibles para los fields son:

TEXT

NUMBER

TELEPHONE

EMAIL

LINK
{% 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/master-db/obtener-estructura-esquema-de-una-master-db.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.
