Wsady i raporty
Wsad ofert
Do 10 000 komunikatów: UPDATE (utwórz/zastąp jak PUT po SKU), PARTIAL_UPDATE (np. cena i stan), PATCH, DELETE. Odpowiedź 202 od razu, przetwarzanie w tle po kolei (messageId).
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/allee/feeds" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0"
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "45.00",
"currency": "PLN"
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "39.90",
"currency": "PLN"
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN"
},
"stock": 15
}
}
]
}
}
JSON<?php
// allee API: POST /allee/feeds (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'feedType' => 'JSON_LISTINGS_FEED',
'content' => [
'header' => [
'sellerId' => 980000001,
'version' => '2.0',
],
'messages' => [
[
'messageId' => 1,
'sku' => 'FILM-21ef85-5',
'operationType' => 'UPDATE',
'requirements' => 'LISTING',
'attributes' => [
'name' => 'Gabinet doktora Caligari DVD',
'category' => [
'alleeId' => 35,
],
'parameters' => [
'225693' => [
'values' => [
'5901234123464',
],
],
'237218' => [
'values' => [
'Metropolis',
],
],
'246845' => [
'valuesIds' => [
'246845_622165',
],
],
'250077' => [
'valuesIds' => [
'250077_1797493',
],
],
'11323' => [
'valuesIds' => [
'11323_1',
],
],
],
'price' => [
'amount' => '45.00',
'currency' => 'PLN',
],
'stock' => 3,
'images' => [
'https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp',
],
'description' => 'Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.',
'shippingRatesId' => '797d2e65-cb23-4a16-98e9-d6f2a399839a',
'responsibleProducerId' => '472bad66-e704-4344-a2d6-9bd85b1f9a5e',
'safetyInformation' => [
'type' => 'TEXT',
'description' => 'Produkt bezpieczny w normalnym użytkowaniu.',
],
],
],
[
'messageId' => 2,
'sku' => 'FILM-21ef85-6',
'operationType' => 'UPDATE',
'requirements' => 'LISTING',
'attributes' => [
'name' => 'Nosferatu DVD wydanie specjalne',
'category' => [
'alleeId' => 35,
],
'parameters' => [
'225693' => [
'values' => [
'5901234123464',
],
],
'237218' => [
'values' => [
'Metropolis',
],
],
'246845' => [
'valuesIds' => [
'246845_622165',
],
],
'250077' => [
'valuesIds' => [
'250077_1797493',
],
],
'11323' => [
'valuesIds' => [
'11323_1',
],
],
],
'price' => [
'amount' => '39.90',
'currency' => 'PLN',
],
'stock' => 5,
'images' => [
'https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp',
],
'description' => 'Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.',
'shippingRatesId' => '797d2e65-cb23-4a16-98e9-d6f2a399839a',
'responsibleProducerId' => '472bad66-e704-4344-a2d6-9bd85b1f9a5e',
'safetyInformation' => [
'type' => 'TEXT',
'description' => 'Produkt bezpieczny w normalnym użytkowaniu.',
],
],
],
[
'messageId' => 3,
'sku' => 'FILM-21ef85-5',
'operationType' => 'PARTIAL_UPDATE',
'attributes' => [
'price' => [
'amount' => '41.90',
'currency' => 'PLN',
],
'stock' => 15,
],
],
],
],
];
$ch = curl_init($base . '/allee/feeds');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: POST /allee/feeds (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",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0",
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35,
},
"parameters": {
"225693": {
"values": [
"5901234123464",
],
},
"237218": {
"values": [
"Metropolis",
],
},
"246845": {
"valuesIds": [
"246845_622165",
],
},
"250077": {
"valuesIds": [
"250077_1797493",
],
},
"11323": {
"valuesIds": [
"11323_1",
],
},
},
"price": {
"amount": "45.00",
"currency": "PLN",
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp",
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu.",
},
},
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35,
},
"parameters": {
"225693": {
"values": [
"5901234123464",
],
},
"237218": {
"values": [
"Metropolis",
],
},
"246845": {
"valuesIds": [
"246845_622165",
],
},
"250077": {
"valuesIds": [
"250077_1797493",
],
},
"11323": {
"valuesIds": [
"11323_1",
],
},
},
"price": {
"amount": "39.90",
"currency": "PLN",
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp",
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu.",
},
},
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN",
},
"stock": 15,
},
},
],
},
}
r = requests.request("POST", BASE + "/allee/feeds", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /allee/feeds (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0"
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "45.00",
"currency": "PLN"
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "39.90",
"currency": "PLN"
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN"
},
"stock": 15
}
}
]
}
};
const res = await fetch(`${BASE}/allee/feeds`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: POST /allee/feeds (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("POST"), baseUrl + "/allee/feeds");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0"
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "45.00",
"currency": "PLN"
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "39.90",
"currency": "PLN"
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN"
},
"stock": 15
}
}
]
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("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: POST /allee/feeds (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");
String body = """
{
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0"
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "45.00",
"currency": "PLN"
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "39.90",
"currency": "PLN"
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN"
},
"stock": 15
}
}
]
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/feeds"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.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: POST /allee/feeds (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"feedType": "JSON_LISTINGS_FEED",
"content": {
"header": {
"sellerId": 980000001,
"version": "2.0"
},
"messages": [
{
"messageId": 1,
"sku": "FILM-21ef85-5",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Gabinet doktora Caligari DVD",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "45.00",
"currency": "PLN"
},
"stock": 3,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 2,
"sku": "FILM-21ef85-6",
"operationType": "UPDATE",
"requirements": "LISTING",
"attributes": {
"name": "Nosferatu DVD wydanie specjalne",
"category": {
"alleeId": 35
},
"parameters": {
"225693": {
"values": [
"5901234123464"
]
},
"237218": {
"values": [
"Metropolis"
]
},
"246845": {
"valuesIds": [
"246845_622165"
]
},
"250077": {
"valuesIds": [
"250077_1797493"
]
},
"11323": {
"valuesIds": [
"11323_1"
]
}
},
"price": {
"amount": "39.90",
"currency": "PLN"
},
"stock": 5,
"images": [
"https://cdn.allee.pl/img/a/webe/1930/10001318-0-1200.webp"
],
"description": "Film na płycie DVD, nowy w folii. Wersja z polskimi napisami.",
"shippingRatesId": "797d2e65-cb23-4a16-98e9-d6f2a399839a",
"responsibleProducerId": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"safetyInformation": {
"type": "TEXT",
"description": "Produkt bezpieczny w normalnym użytkowaniu."
}
}
},
{
"messageId": 3,
"sku": "FILM-21ef85-5",
"operationType": "PARTIAL_UPDATE",
"attributes": {
"price": {
"amount": "41.90",
"currency": "PLN"
},
"stock": 15
}
}
]
}
}`
req, err := http.NewRequest("POST", base+"/allee/feeds", strings.NewReader(body))
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")
req.Header.Set("Content-Type", "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))
}Stan: GET /allee/feeds/{feedId} albo powiadomienie FEED_PROCESSING_FINISHED. Wynik każdego komunikatu:
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result');
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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result`, {
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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result");
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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result"))
.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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result (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/feeds/8abb06e8-6e07-4bbb-b0d7-7fda5882df49/result", 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))
}Duży wsad: najpierw POST /allee/feeds/documents (podpisany adres PUT, do 10 MB), wgraj dokument, potem POST /allee/feeds z inputFeedDocumentId. Tylko ceny i stany w kształcie zbliżonym do Allegro: POST /sale/offer-bulk-modification-commands.
Raporty
Typy: OFFERS_ALL, OFFERS_ISSUES, ORDERS_BY_DATE, RETURNS, BILLING_ENTRIES, API_USAGE; CSV albo JSON, gzip, okres do 92 dni, dokument przechowywany 7 dni.
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
JSON<?php
// allee API: POST /allee/reports (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'reportType' => 'OFFERS_ALL',
'reportOptions' => [
'format' => 'CSV',
],
];
$ch = curl_init($base . '/allee/reports');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: POST /allee/reports (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",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV",
},
}
r = requests.request("POST", BASE + "/allee/reports", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /allee/reports (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
};
const res = await fetch(`${BASE}/allee/reports`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: POST /allee/reports (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("POST"), baseUrl + "/allee/reports");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("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: POST /allee/reports (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");
String body = """
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/reports"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.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: POST /allee/reports (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}`
req, err := http.NewRequest("POST", base+"/allee/reports", strings.NewReader(body))
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")
req.Header.Set("Content-Type", "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))
}curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document');
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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document`, {
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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document");
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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document"))
.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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document", 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))
}Adres z odpowiedzi jest podpisany i ważny 5 minut — pobierz go bez tokenu:
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…" \
-H "Accept: application/gzip" \
-o raport.csv.gz -w 'HTTP %{http_code}\n'<?php
// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Accept: application/gzip',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
$kod = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($kod === 200) file_put_contents('raport.csv.gz', $odp);
echo 'HTTP ', $kod, "\n";# allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Accept": "application/gzip",
}
r = requests.request("GET", BASE + "/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…", headers=headers, timeout=60, allow_redirects=False)
if r.status_code == 200:
with open("raport.csv.gz", "wb") as f:
f.write(r.content)
print("HTTP", r.status_code)// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Node.js 18+, wbudowany fetch; plik .mjs)
import { readFile, writeFile } from "node:fs/promises";
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…`, {
method: "GET",
headers: {
"Accept": "application/gzip",
},
redirect: "manual",
});
if (res.status === 200) await writeFile("raport.csv.gz", Buffer.from(await res.arrayBuffer()));
console.log("HTTP", res.status);// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (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/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…");
req.Headers.Accept.ParseAdd("application/gzip");
using var res = await http.SendAsync(req);
if ((int)res.StatusCode == 200) File.WriteAllBytes("raport.csv.gz", await res.Content.ReadAsByteArrayAsync());
Console.WriteLine($"HTTP {(int)res.StatusCode}");// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (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;
import java.nio.file.Path;
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/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…"))
.header("Accept", "application/gzip")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<Path> res = http.send(req, HttpResponse.BodyHandlers.ofFile(Path.of("raport.csv.gz")));
System.out.println("HTTP " + res.statusCode());
}
}// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"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/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…", nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/gzip")
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()
if res.StatusCode == 200 {
f, err := os.Create("raport.csv.gz")
if err != nil {
panic(err)
}
defer f.Close()
if _, err := f.ReadFrom(res.Body); err != nil {
panic(err)
}
}
fmt.Println("HTTP", res.StatusCode)
}