allegro-api icon indicating copy to clipboard operation
allegro-api copied to clipboard

[NEWS] Usunęliśmy metody WebAPI do obsługi drzewa kategorii

Open PrzemyslawLukanowski opened this issue 6 years ago • 2 comments

Przypominamy, że zgodnie z wcześniejszą zapowiedzią, usunęliśmy dzisiaj metody do obsługi drzewa kategorii:

O tym, jak korzystać z odpowiedników tych metod w REST API, dowiesz się z dokumentacji.

PrzemyslawLukanowski avatar Jul 15 '19 09:07 PrzemyslawLukanowski

@PrzemyslawLukanowski mam problem z przepisaniem doGetCatsData

Wszystkie kategorie jakie dostaję mają parent = null. Jak dostać się do subkategorii?

{
	"categories": [
		{
			"id": "5",
			"name": "Dom i Ogród",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "11763",
			"name": "Dziecko",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "42540aec-367a-4e5e-b411-17c09b08e41f",
			"name": "Elektronika",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": true,
				"productCreationEnabled": true,
				"customParametersEnabled": true
			}
		},
		{
			"id": "4bd97d96-f0ff-46cb-a52c-2992bd972bb1",
			"name": "Firma i usługi",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "a408e75a-cede-4587-8526-54e9be600d9f",
			"name": "Kolekcje i sztuka",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": false
			}
		},
		{
			"id": "38d588fd-7e9c-4c42-a4ae-6831775eca45",
			"name": "Kultura i rozrywka",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "ea5b98dd-4b6f-4bd0-8c80-22c2629132d0",
			"name": "Moda",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "3",
			"name": "Motoryzacja",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "20782",
			"name": "Nieruchomości",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": false,
				"advertisement": true,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": false
			}
		},
		{
			"id": "3919",
			"name": "Sport i turystyka",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "258832",
			"name": "Supermarket",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		},
		{
			"id": "1429",
			"name": "Uroda",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": true,
				"productCreationEnabled": true,
				"customParametersEnabled": true
			}
		},
		{
			"id": "121882",
			"name": "Zdrowie",
			"parent": null,
			"leaf": false,
			"options": {
				"variantsByColorPatternAllowed": true,
				"advertisement": false,
				"advertisementPriceOptional": false,
				"offersWithProductPublicationEnabled": false,
				"productCreationEnabled": false,
				"customParametersEnabled": true
			}
		}
	]
}

jedyna metoda jaką obecnie widzę to przeszukanie wszystkich

https://api.allegro.pl.allegrosandbox.pl/sale/categories/:id

z id od 1 do 20000, ale mam nadzieję, ze jest lepsza implementacja pobrania podkategorii.

gustawdaniel avatar Oct 04 '22 10:10 gustawdaniel

Do zbioru subkategorii dostaniesz się, gdy do requestu dołożysz parametr parent.id, np. GET /sale/categories?parent.id=5.

PrzemyslawLukanowski avatar Oct 04 '22 10:10 PrzemyslawLukanowski