Kategorie allee
To samo drzewo po identyfikatorach allee + schemat atrybutów kategorii (JSON Schema).
- GET
/allee/categories— Lista kategorii (identyfikatory allee) - GET
/allee/categories/{alleeCategoryId}— Kategoria (identyfikator allee) - GET
/allee/categories/{alleeCategoryId}/parameters— Parametry kategorii (identyfikator allee) - GET
/allee/categories/{alleeCategoryId}/schema— Schemat atrybutów kategorii (JSON Schema)
Lista kategorii (identyfikatory allee)
GET /allee/categories
tylko alleelimit: read
To samo drzewo co /sale/categories, ale po identyfikatorach allee (parent.id = alleeId).
Zgodność: tylko allee — GET /sale/categories (po alleeId).
Uprawnienie: dowolny ważny token lub klucz (działa też token aplikacji client_credentials).
Grupa limitu: read.
Parametry zapytania
parent.id integeralleeId kategorii nadrzędnej; brak = działy główne.
Odpowiedzi
200 Kategorie. · AlleeCategoryList
categories array<AlleeCategory> zawszePola obiektu
alleeId integer zawszeid string · null zawszeIdentyfikator Allegro (mapa 1:1).
name string zawszeparent object · null zawszePola obiektu
alleeId integer zawszeid string · null zawszeleaf boolean zawszepath array<object>Ścieżka od działu głównego (tylko pojedyncza kategoria).
Pola obiektu
alleeId integer zawszeid string · null zawszename string zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | CATEGORY_NOT_FOUND | Nie ma takiej kategorii. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/categories?parent.id=6" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/categories (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/categories?parent.id=6');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /allee/categories (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/allee/categories?parent.id=6", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/categories (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/categories?parent.id=6`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /allee/categories (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/allee/categories?parent.id=6");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /allee/categories (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/categories?parent.id=6"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /allee/categories (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/allee/categories?parent.id=6", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"categories": [
{
"alleeId": 17,
"id": "66813",
"name": "Audiobooki - CD",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 18,
"id": "253753",
"name": "Audiobooki - mp3",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 20,
"id": "300881",
"name": "Bilety",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 25,
"id": "118",
"name": "Czasopisma",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 32,
"id": "5893",
"name": "Ebooki",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 35,
"id": "20585",
"name": "Filmy",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": true
},
{
"alleeId": 38,
"id": "306453",
"name": "Gadżety",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 39,
"id": "9",
"name": "Gry",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 44,
"id": "122640",
"name": "Instrumenty",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 45,
"id": "28496",
"name": "Kalendarze, notesy, planery",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 47,
"id": "257900",
"name": "Kody i doładowania",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 50,
"id": "79413",
"name": "Komiksy",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 54,
"id": "7",
"name": "Książki",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 57,
"id": "325021",
"name": "Mapy, atlasy",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": true
},
{
"alleeId": 63,
"id": "1",
"name": "Muzyka",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": true
},
{
"alleeId": 75,
"id": "66820",
"name": "Podręczniki szkolne",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": false
},
{
"alleeId": 109,
"id": "301130",
"name": "Wyjątkowe chwile",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": true
}
]
}Kategoria (identyfikator allee)
GET /allee/categories/{alleeCategoryId}
tylko alleelimit: read
Kategoria ze ścieżką od działu głównego (path).
Zgodność: tylko allee — GET /sale/categories/{categoryId}.
Uprawnienie: dowolny ważny token lub klucz (działa też token aplikacji client_credentials).
Grupa limitu: read.
Parametry ścieżki
alleeCategoryId integer wymaganyalleeId kategorii.
Odpowiedzi
200 Kategoria. · AlleeCategory
alleeId integer zawszeid string · null zawszeIdentyfikator Allegro (mapa 1:1).
name string zawszeparent object · null zawszePola obiektu
alleeId integer zawszeid string · null zawszeleaf boolean zawszepath array<object>Ścieżka od działu głównego (tylko pojedyncza kategoria).
Pola obiektu
alleeId integer zawszeid string · null zawszename string zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | CATEGORY_NOT_FOUND | Nie ma takiej kategorii. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/categories/35" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/categories/35 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/categories/35');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /allee/categories/35 (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/allee/categories/35", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/categories/35 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/categories/35`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /allee/categories/35 (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/allee/categories/35");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /allee/categories/35 (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/categories/35"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /allee/categories/35 (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/allee/categories/35", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"alleeId": 35,
"id": "20585",
"name": "Filmy",
"parent": {
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45"
},
"leaf": true,
"path": [
{
"alleeId": 6,
"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45",
"name": "Kultura i rozrywka"
},
{
"alleeId": 35,
"id": "20585",
"name": "Filmy"
}
]
}Parametry kategorii (identyfikator allee)
GET /allee/categories/{alleeCategoryId}/parameters
tylko alleelimit: read
Identyczna lista jak /sale/categories/{id}/parameters.
Zgodność: tylko allee — GET /sale/categories/{categoryId}/parameters.
Uprawnienie: dowolny ważny token lub klucz (działa też token aplikacji client_credentials).
Grupa limitu: read.
Parametry ścieżki
alleeCategoryId integer wymaganyalleeId kategorii.
Odpowiedzi
200 Parametry. · CategoryParameterList
parameters array<CategoryParameter> zawszePola obiektu
id string zawszeIdentyfikator parametru Allegro.
alleeId integer zawszeIdentyfikator allee.
name string zawszetype string zawszedictionary, integer, float, stringrequired boolean zawszeWymagany w tej kategorii.
requiredForProduct boolean zawszeZawsze false (allee nie ma kart produktów).
unit string · null zawszeJednostka, np. kg.
options object zawszePola obiektu
customValuesEnabled boolean zawszeZawsze false — tylko wartości ze słownika.
ambiguousValueId string · null zawszerestrictions object zawszeOgraniczenia wartości (sprawdzane przy zapisie oferty).
Pola obiektu
multipleChoices booleanCzy wolno wybrać kilka wartości słownika.
minLength integermaxLength integerallowedNumberOfValues integermin numbermax numberrange booleanZawsze false (zakresy nieobsługiwane).
precision integerMiejsca po przecinku (float).
dictionary array<object>Wartości słownika (typ dictionary).
Pola obiektu
id string zawszeIdentyfikator wartości Allegro.
alleeId integer zawszevalue string zawszedependsOnValueIds array<string> zawszePrzekazujemy jak Allegro, nie sprawdzamy przy zapisie.
options objectPola obiektu
alleeSupported boolean zawszeParametr Stan: czy allee przyjmuje tę wartość.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | CATEGORY_NOT_FOUND | Nie ma takiej kategorii. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/categories/35/parameters" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/categories/35/parameters (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/categories/35/parameters');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /allee/categories/35/parameters (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/allee/categories/35/parameters", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/categories/35/parameters (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/categories/35/parameters`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /allee/categories/35/parameters (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/allee/categories/35/parameters");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /allee/categories/35/parameters (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/categories/35/parameters"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /allee/categories/35/parameters (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/allee/categories/35/parameters", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"parameters": [
{
"id": "11323",
"alleeId": 669,
"name": "Stan",
"type": "dictionary",
"required": true,
"requiredForProduct": false,
"unit": null,
"options": {
"customValuesEnabled": false,
"ambiguousValueId": null
},
"restrictions": {
"multipleChoices": false
},
"dictionary": [
{
"id": "11323_1",
"alleeId": 6386,
"value": "Nowy",
"dependsOnValueIds": [],
"options": {
"alleeSupported": true
}
},
{
"id": "11323_2",
"alleeId": 6387,
"value": "Używany",
"dependsOnValueIds": [],
"options": {
"alleeSupported": true
}
}
]
},
{
"id": "246845",
"alleeId": 8973,
"name": "Nośnik",
"type": "dictionary",
"required": true,
"requiredForProduct": false,
"unit": null,
"options": {
"customValuesEnabled": false,
"ambiguousValueId": null
},
"restrictions": {
"multipleChoices": false
},
"dictionary": [
{
"id": "246845_622161",
"alleeId": 79215,
"value": "płyta Blu-ray 3D",
"dependsOnValueIds": []
},
{
"id": "246845_622165",
"alleeId": 79216,
"value": "płyta DVD",
"dependsOnValueIds": []
},
{
"id": "246845_622169",
"alleeId": 79217,
"value": "płyta Blu-ray",
"dependsOnValueIds": []
},
{
"id": "246845_728783",
"alleeId": 79218,
"value": "płyta Blu-ray 4K",
"dependsOnValueIds": []
},
{
"id": "246845_622173",
"alleeId": 79219,
"value": "płyta VCD",
"dependsOnValueIds": []
},
{
"id": "246845_622177",
"alleeId": 79220,
"value": "kaseta wideo",
"dependsOnValueIds": []
},
{
"id": "246845_738593",
"alleeId": 79221,
"value": "płyta DVD+Książka",
"dependsOnValueIds": []
}
]
},
{
"id": "250077",
"alleeId": 10923,
"name": "Gatunek",
"type": "dictionary",
"required": true,
"requiredForProduct": false,
"unit": null,
"options": {
"customValuesEnabled": false,
"ambiguousValueId": null
},
"restrictions": {
"multipleChoices": false
},
"dictionary": [
{
"id": "250077_1797493",
"alleeId": 258674,
"value": "anime",
"dependsOnValueIds": []
},
{
"id": "250077_1797494",
"alleeId": 258675,
"value": "bollywood",
"dependsOnValueIds": []
},
{
"id": "250077_1797495",
"alleeId": 258676,
"value": "dla dzieci",
"dependsOnValueIds": []
},
{
"id": "250077_1797496",
"alleeId": 258677,
"value": "dokumentalne",
"dependsOnValueIds": []
},
{
"id": "250077_1797497",
"alleeId": 258678,
"value": "dramaty",
"dependsOnValueIds": []
},
{
"id": "250077_1797498",
"alleeId": 258679,
"value": "fantasy",
"dependsOnValueIds": []
},
{
"id": "250077_1797499",
"alleeId": 258680,
"value": "horrory",
"dependsOnValueIds": []
},
{
"id": "250077_1797500",
"alleeId": 258681,
"value": "kabarety",
"dependsOnValueIds": []
},
{
"id": "250077_1797501",
"alleeId": 258682,
"value": "komedie",
"dependsOnValueIds": []
},
{
"id": "250077_1797503",
"alleeId": 258683,
"value": "kostiumowe",
"dependsOnValueIds": []
},
{
"id": "250077_1797504",
"alleeId": 258684,
"value": "kryminały",
"dependsOnValueIds": []
},
{
"id": "250077_1797505",
"alleeId": 258685,
"value": "kursy, ćwiczenia",
"dependsOnValueIds": []
},
{
"id": "250077_1797506",
"alleeId": 258686,
"value": "musicale",
"dependsOnValueIds": []
},
{
"id": "250077_1797507",
"alleeId": 258687,
"value": "opery",
"dependsOnValueIds": []
},
{
"id": "250077_1797508",
"alleeId": 258688,
"value": "popularnonaukowe",
"dependsOnValueIds": []
},
{
"id": "250077_1797510",
"alleeId": 258689,
"value": "przygodowe",
"dependsOnValueIds": []
},
{
"id": "250077_1797511",
"alleeId": 258690,
"value": "romanse",
"dependsOnValueIds": []
},
{
"id": "250077_1797512",
"alleeId": 258691,
"value": "science fiction",
"dependsOnValueIds": []
},
{
"id": "250077_1797513",
"alleeId": 258692,
"value": "sensacyjne",
"dependsOnValueIds": []
},
{
"id": "250077_1797514",
"alleeId": 258693,
"value": "seriale",
"dependsOnValueIds": []
},
{
"id": "250077_1797515",
"alleeId": 258694,
"value": "spektakle teatralne",
"dependsOnValueIds": []
},
{
"id": "250077_1797516",
"alleeId": 258695,
"value": "thrillery",
"dependsOnValueIds": []
},
{
"id": "250077_1797
… (skrócono — pełna odpowiedź ma 40 KB)Schemat atrybutów kategorii (JSON Schema)
GET /allee/categories/{alleeCategoryId}/schema
wzór Amazon SP-APIlimit: read
JSON Schema 2020-12 treści PUT /allee/listings/{sku} dla kategorii: atrybuty, wymagalność, wartości słowników, zakresy, jednostki. Waliduj dokument u siebie, zanim wyślesz — te same reguły sprawdza API.
Odpowiedź ma ETag (= meta.version): wyślij If-None-Match, a dostaniesz 304, gdy schemat się nie zmienił.
Zgodność: wzorowana na Amazon Selling Partner API — Product Type Definitions — getDefinitionsProductType.
Uprawnienie: dowolny ważny token lub klucz (działa też token aplikacji client_credentials).
Grupa limitu: read.
Parametry ścieżki
alleeCategoryId integer wymaganyalleeId kategorii-liścia.
Parametry zapytania
requirements stringLISTING = pełna oferta; LISTING_OFFER_ONLY = dane sprzedażowe istniejącego SKU.
LISTING, LISTING_OFFER_ONLYOdpowiedzi
200 Schemat. · CategorySchema
category object zawszePola obiektu
alleeId integer zawszeid string · null zawszename string zawszerequirements string zawszeLISTING = pełna oferta, LISTING_OFFER_ONLY = tylko dane sprzedażowe istniejącego SKU.
LISTING, LISTING_OFFER_ONLYmetaSchema object zawszePola obiektu
link object zawszePola obiektu
resource string zawszeAdres meta-schematu JSON Schema 2020-12.
verb string zawszeGETschema object zawszeJSON Schema 2020-12 treści PUT /allee/listings/{sku} dla tej kategorii: properties.attributes opisuje atrybuty, parameters — parametry kategorii (klucz = id parametru Allegro, enum wartości słownika, x-allee: alleeId, typ, jednostka).
meta object zawszePola obiektu
version string zawszeSkrót wersji schematu — zmienia się, gdy zmieni się kategoria lub jej parametry (ETag).
generatedAt string · date-time zawszepropertyGroups object zawszeGrupy atrybutów do formularzy (produkt, oferta, warunki, GPSR).
304 Bez zmian (If-None-Match).
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 400 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | CATEGORY_NOT_FOUND | Nie ma takiej kategorii. |
| 422 | CATEGORY_NOT_LEAF | Kategoria nie jest liściem. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/categories/35/schema?requirements=LISTING" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/categories/35/schema (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/categories/35/schema?requirements=LISTING');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /allee/categories/35/schema (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/allee/categories/35/schema?requirements=LISTING", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/categories/35/schema (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/categories/35/schema?requirements=LISTING`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /allee/categories/35/schema (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/allee/categories/35/schema?requirements=LISTING");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /allee/categories/35/schema (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/categories/35/schema?requirements=LISTING"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /allee/categories/35/schema (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/allee/categories/35/schema?requirements=LISTING", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"category": {
"alleeId": 35,
"id": "20585",
"name": "Filmy"
},
"requirements": "LISTING",
"metaSchema": {
"link": {
"resource": "https://json-schema.org/draft/2020-12/schema",
"verb": "GET"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://api.allee.pl/allee/categories/35/schema?requirements=LISTING",
"title": "Oferta allee — Filmy",
"description": "Treść PUT /allee/listings/{sku}. Ceny brutto w PLN. Parametry: klucz = id parametru Allegro (GET /allee/categories/35/parameters).",
"type": "object",
"required": [
"attributes"
],
"additionalProperties": false,
"properties": {
"requirements": {
"enum": [
"LISTING",
"LISTING_OFFER_ONLY"
],
"default": "LISTING"
},
"status": {
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "INACTIVE",
"description": "ACTIVE = publikuj (wymaga GPSR); INACTIVE = szkic albo bez zmiany statusu."
},
"productType": {
"type": "string",
"description": "Pomijane (zgodność z klientami Amazon)."
},
"attributes": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"category",
"images",
"description",
"price",
"stock",
"shippingRatesId",
"parameters"
],
"properties": {
"name": {
"type": "string",
"minLength": 10,
"maxLength": 75,
"pattern": "^(?!.*\\S{31})",
"title": "Tytuł oferty",
"description": "10–75 znaków, żadne słowo dłuższe niż 30 znaków.",
"examples": [
"Przykładowy produkt testowy allee"
]
},
"category": {
"type": "object",
"title": "Kategoria",
"additionalProperties": false,
"properties": {
"alleeId": {
"const": 35
},
"id": {
"const": "20585"
}
},
"minProperties": 1,
"examples": [
{
"alleeId": 35
}
]
},
"parameters": {
"type": "object",
"title": "Parametry kategorii (klucz = id parametru Allegro)",
"properties": {
"11323": {
"title": "Stan",
"x-allee": {
"alleeId": 669,
"type": "dictionary",
"unit": null
},
"type": "object",
"properties": {
"valuesIds": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"11323_253798",
"11323_253802",
"11323_253806",
"11323_1",
"11323_2",
"11323_238066",
"11323_1223453",
"11323_238070",
"11323_246514",
"11323_238058",
"11323_238062",
"11323_1223636",
"11323_246538",
"11323_246510",
"11323_246462",
"11323_246534",
"11323_2036070",
"11323_1223635",
"11323_1223462",
"11323_246466",
"11323_852680",
"11323_2036071",
"11323_2036072"
],
"enumNames": [
"Do renowacji",
"Po renowacji",
"Nie wymaga renowacji",
"Nowy",
"Używany",
"Po zwrocie",
"Na części",
"Niepełny komplet",
"Nowy z defektem",
"Powystawowy",
"Uszkodzony",
"Przepakowany",
"Odnowiony przez sprzedawcę",
"Nowy bez metki",
"Regenerowany",
"Odnowiony przez producenta",
"Produkt cyfrowy",
"Po demontażu",
"Niepełny zestaw",
"Bieżnikowany",
"Z demontażu (demo)",
"Produkt inwestycyjny",
"Produkt kolekcjonerski"
]
},
"maxItems": 1
},
"values": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"Do renowacji",
"Po renowacji",
"Nie wymaga renowacji",
"Nowy",
"Używany",
"Po zwrocie",
"Na części",
"Niepełny komplet",
"Nowy z defektem",
"Powystawowy",
"Uszkodzony",
"Przepakowany",
"Odnowiony przez sprzedawcę",
"Nowy bez metki",
"Regenerowany",
… (skrócono — pełna odpowiedź ma 55 KB)