Endpoint
Restituisce l'albero completo del catalogo: categorie e prodotti (simboli) con nomi in più lingue, descrizioni, tipi di elementi. La risposta contiene una raccolta di elementi che possono avere elementi nidificati (sottocategorie/gruppi).
Request
-
Accept stringPossible values: application/json
Tipo di risposta previsto.
Default value: application/json
Response
{
"Elements": [
{
"Id": 0,
"DescriptiveName": "Root",
"Key": "0",
"Name": [
{ "LangSymbol": "PL", "Value": "Root" }
],
"Description": [],
"Picture": "",
"Products": [],
"Elements": [
{
"Id": 527865,
"DescriptiveName": "Wszystkie",
"Key": "1",
"Name": [
{ "LangSymbol": "EN", "Value": "All products" },
{ "LangSymbol": "PL", "Value": "Wszystkie produkty" }
],
"Description": [],
"Picture": "",
"Products": [],
"Elements": [
{
"Id": 101675,
"DescriptiveName": "Ultra",
"Key": "101675",
"Name": [
{ "LangSymbol": "EN", "Value": "Ultra" },
{ "LangSymbol": "PL", "Value": "Ultra" }
],
"Description": [
{ "LangSymbol": "EN", "Value": "chair polished aluminium base" },
{ "LangSymbol": "PL", "Value": "krzesło podstawa aluminium polerowane" }
],
"Picture": "",
"Products": [
{ "Symbol": "UFBPP19", "DirectDigital": 1 },
{ "Symbol": "UFPP19K", "DirectDigital": 1 }
],
"Elements": [],
"Type": 4,
"TypeName": "Symbol wirtualny",
"DirectDigital": 1,
"JoinID": 0,
"IsMain": 1,
"IsHidden": 0,
"MainKeyForElement": 101675,
"InvisibleOnPricelist": 0,
"InvisibleOnPricelistCurrencies": [ "SEK" ]
}
],
"Type": 1,
"TypeName": "Kategoria",
"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
Elenco degli elementi dell'albero del catalogo (categorie, gruppi, simboli virtuali, ecc.).
-
Elements[].Id integer Required
Identificatore dell'elemento nel database.
-
Elements[].DescriptiveName string|null
Nome descrittivo dell'elemento (spesso più “dizionario” rispetto a Name[].Value).
-
Elements[].Key string Required
Chiave astratta dell'elemento (stringa di caratteri utilizzata nel catalogo).
-
Elements[].Name array<object>
Nomi dell'elemento in diverse lingue.
-
Elements[].Name[].LangSymbol string RequiredPossible values: PL EN DE ES FR IT
Codice lingua (due lettere, ad es. PL, EN, DE).
-
Elements[].Name[].Value string Required
Nome dell'elemento nella lingua specificata.
-
Elements[].Description array<object>
Descrizioni dell'elemento in diverse lingue.
-
Elements[].Description[].LangSymbol string RequiredPossible values: PL EN DE ES FR IT
Codice lingua della descrizione.
-
Elements[].Description[].Value string Required
Descrizione nella lingua specificata (può essere vuota).
-
Elements[].Picture string
URL dell'immagine associata all'elemento (se esistente).
-
Elements[].Products array<object>
Elenco dei prodotti (simboli) associati all'elemento (ad es. alla categoria/famiglia).
-
Elements[].Products[].Symbol string Required
Simbolo del prodotto (SKU).
-
Elements[].Products[].DirectDigital integer RequiredPossible values: 0 1
Flag di disponibilità del simbolo in Direct Digital (0 - no, 1 - sì).
-
Elements[].Elements array<object>
Elementi nidificati (sottocategorie / gruppi / nodi dell'albero) con la stessa struttura di Elements[].
-
Elements[].Type integer Required
Codice del tipo di elemento (ad es. root, categoria, simbolo virtuale – significato esatto dal lato del sistema).
-
Elements[].TypeName string Required
Nome del tipo di elemento (ad es. “Root”, “Simbolo virtuale”, “Categoria”).
-
Elements[].DirectDigital integerPossible values: 0 1
Flag che indica se un determinato elemento (ramo) è disponibile in Direct Digital.
-
Elements[].JoinID integer
ID dell'elemento a cui è collegato (ad es. record “originale”).
Default value: 0 -
Elements[].IsMain integerPossible values: 0 1
Se l'elemento è l'elemento principale? (1 - sì, 0 - no)
Default value: 0 -
Elements[].IsHidden integerPossible values: 0 1
Se l'elemento deve essere nascosto nella pagina? (1 - nascosto, 0 - visibile)
Default value: 0 -
Elements[].MainKeyForElement integer
Chiave dell'elemento padre/principale, se questo non è principale.
Default value: 0 -
Elements[].InvisibleOnPricelist integerPossible values: 0 1
Se l'elemento deve essere invisibile nel listino prezzi? (1 - nascosto, 0 - visibile)
Default value: 0 -
Elements[].InvisibleOnPricelistCurrencies array<string>
Elenco dei codici valuta per i quali l'elemento deve essere nascosto nel listino prezzi.
{
"status": 500,
"error": "server_error",
"message": "Si è verificato un errore del server."
}
Implementation
Esempi di chiamata dell'endpoint (GET anonimo, senza intestazione Authorization) per /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);
}
}