Endpoint
Devuelve el árbol completo del catálogo: categorías y productos (símbolos) con nombres en varios idiomas, descripciones, tipos de elementos. La respuesta contiene una colección de elementos que pueden tener elementos anidados (subcategorías/grupos).
Request
-
Accept stringPossible values: application/json
Tipo de respuesta esperada.
Default value: application/json
Response
{
"Elements": [
{
"Id": 0,
"DescriptiveName": "Root",
"Key": "0",
"Name": [
{ "LangSymbol": "ES", "Value": "Raíz" }
],
"Description": [],
"Picture": "",
"Products": [],
"Elements": [
{
"Id": 527865,
"DescriptiveName": "Todos",
"Key": "1",
"Name": [
{ "LangSymbol": "EN", "Value": "All products" },
{ "LangSymbol": "ES", "Value": "Todos los productos" }
],
"Description": [],
"Picture": "",
"Products": [],
"Elements": [
{
"Id": 101675,
"DescriptiveName": "Ultra",
"Key": "101675",
"Name": [
{ "LangSymbol": "EN", "Value": "Ultra" },
{ "LangSymbol": "ES", "Value": "Ultra" }
],
"Description": [
{ "LangSymbol": "EN", "Value": "chair polished aluminium base" },
{ "LangSymbol": "ES", "Value": "silla con base de aluminio pulido" }
],
"Picture": "",
"Products": [
{ "Symbol": "UFBPP19", "DirectDigital": 1 },
{ "Symbol": "UFPP19K", "DirectDigital": 1 }
],
"Elements": [],
"Type": 4,
"TypeName": "Símbolo virtual",
"DirectDigital": 1,
"JoinID": 0,
"IsMain": 1,
"IsHidden": 0,
"MainKeyForElement": 101675,
"InvisibleOnPricelist": 0,
"InvisibleOnPricelistCurrencies": [ "SEK" ]
}
],
"Type": 1,
"TypeName": "Categoría",
"DirectDigital": 1,
"JoinID": 0,
"IsMain": 0,
"IsHidden": 0,
"MainKeyForElement": 1,
"InvisibleOnPricelist": 0,
"InvisibleOnPricelistCurrencies": []
}
],
"Type": 0,
"TypeName": "Root",
"DirectDigital": 1,
"JoinID": 0,
"IsMain": 0,
"IsHidden": 0,
"MainKeyForElement": 0,
"InvisibleOnPricelist": 0,
"InvisibleOnPricelistCurrencies": []
}
]
}
-
Elements array<object> Required
Lista de elementos del árbol del catálogo (categorías, grupos, símbolos virtuales, etc.).
-
Elements[].Id integer Required
Identificador del elemento en la base de datos.
-
Elements[].DescriptiveName string|null
Nombre descriptivo del elemento (a menudo más «diccionario» que Name[].Value).
-
Elements[].Key string Required
Clave abstracta del elemento (cadena de caracteres utilizada en el catálogo).
-
Elements[].Name array<object>
Nombres del elemento en diferentes idiomas.
-
Elements[].Name[].LangSymbol string RequiredPossible values: PL EN DE ES FR IT
Código del idioma (dos letras, p. ej., PL, EN, DE).
-
Elements[].Name[].Value string Required
Nombre del elemento en el idioma correspondiente.
-
Elements[].Description array<object>
Descripciones del elemento en diferentes idiomas.
-
Elements[].Description[].LangSymbol string RequiredPossible values: PL EN DE ES FR IT
Código del idioma de la descripción.
-
Elements[].Description[].Value string Required
Descripción en el idioma correspondiente (puede estar vacío).
-
Elements[].Picture string
URL de la imagen asociada al elemento (si existe).
-
Elements[].Products array<object>
Lista de productos (símbolos) relacionados con el elemento (por ejemplo, con la categoría/familia).
-
Elements[].Products[].Symbol string Required
Símbolo del producto (SKU).
-
Elements[].Products[].DirectDigital integer RequiredPossible values: 0 1
Indicador de disponibilidad del símbolo en Direct Digital (0: no, 1: sí).
-
Elements[].Elements array<object>
Elementos anidados (subcategorías / grupos / nodos del árbol) con la misma estructura que Elements[].
-
Elements[].Type integer Required
Código del tipo de elemento (por ejemplo, raíz, categoría, símbolo virtual; significado exacto por parte del sistema).
-
Elements[].TypeName string Required
Nombre del tipo de elemento (por ejemplo, «Raíz», «Símbolo virtual», «Categoría»).
-
Elements[].DirectDigital integerPossible values: 0 1
Indicador de si el elemento (rama) está disponible en Direct Digital.
-
Elements[].JoinID integer
ID del elemento con el que está vinculado (por ejemplo, registro «original»).
Default value: 0 -
Elements[].IsMain integerPossible values: 0 1
Si el elemento es el elemento principal (1 = sí, 0 = no).
Default value: 0 -
Elements[].IsHidden integerPossible values: 0 1
Si el elemento debe ocultarse en la página (1 = oculto, 0 = visible).
Default value: 0 -
Elements[].MainKeyForElement integer
Clave del elemento superior/principal, si este no es el principal.
Default value: 0 -
Elements[].InvisibleOnPricelist integerPossible values: 0 1
Si el elemento debe ser invisible en la lista de precios (1 = oculto, 0 = visible).
Default value: 0 -
Elements[].InvisibleOnPricelistCurrencies array<string>
Lista de códigos de divisas para los que el elemento debe ocultarse en la lista de precios.
{
"status": 500,
"error": "server_error",
"message": "Se ha producido un error del servidor."
}
Implementation
Ejemplos de llamada al punto final (GET anónimo, sin encabezado Authorization) para /externalapi/categories.
<?php
declare(strict_types=1);
$endpoint = 'https://external-api.mddlinx.com/externalapi/categories';
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Accept: application/json',
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$body = curl_exec($ch);
$errno = curl_errno($ch);
$error = curl_error($ch);
$http = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($errno) {
throw new RuntimeException($error);
}
if ($http < 200 || $http >= 300) {
throw new RuntimeException('HTTP ' . $http . ': ' . $body);
}
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
print_r($data);
<?php
use Illuminate\Support\Facades\Http;
$endpoint = 'https://external-api.mddlinx.com/externalapi/categories';
$response = Http::acceptJson()
->timeout(60)
->get($endpoint);
if ($response->failed()) {
throw new RuntimeException('HTTP ' . $response->status() . ': ' . $response->body());
}
$tree = $response->json();
print_r($tree);
const endpoint = 'https://external-api.mddlinx.com/externalapi/categories';
(async () => {
const res = await fetch(endpoint, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
});
if (!res.ok) {
throw new Error('HTTP ' + res.status + ': ' + (await res.text()));
}
const data = await res.json();
console.log(data);
})();
import requests
endpoint = 'https://external-api.mddlinx.com/externalapi/categories'
r = requests.get(
endpoint,
headers={
'Accept': 'application/json',
},
timeout=60,
)
r.raise_for_status()
print(r.json())
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program {
static async Task Main() {
var endpoint = "https://external-api.mddlinx.com/externalapi/categories";
using var http = new HttpClient();
http.DefaultRequestHeaders.Accept.ParseAdd("application/json");
var res = await http.GetAsync(endpoint);
var body = await res.Content.ReadAsStringAsync();
if (!res.IsSuccessStatusCode)
throw new Exception("HTTP " + (int)res.StatusCode + ": " + body);
Console.WriteLine(body);
}
}