allegro / allegro/allegro-api

[NEWS] Kategorie i parametry - dodaliśmy dziennik zmian w kategoriach oraz zasób, dzięki któremu sprawdzisz przyszłe zdarzenia na parametrach / Categories and parameters - we have introduced an event journal in categories and resource with which you can check future changes in parameters

未关闭
#4,065 1 条评论 0 个 reaction 已指派 1 人 已被 @PrzemyslawLukanowski 认领 在 GitHub 查看
News Offer - categories and parameters
主要语言
没有语言数据
星标
244
派生
40
PR 合并指标
30 天内没有已合并 PR

描述

Udostępniliśmy dziś dwa nowe zasoby, które pozwolą ci śledzić zmiany w kategoriach i parametrach na naszej platformie:

- [GET /sale/category-events](https://developer.allegro.pl/documentation/#operation/getCategoryEventsUsingGET_1) - sprawdź zmiany w kategoriach, które wydarzyły się w ostatnich 3 miesiącach. Domyślnie w odpowiedzi otrzymasz listę 100 najstarszych zdarzeń. Za pomocą parametru **from** i **ID danego zdarzenia** możesz pobrać kolejną porcję danych. Aktualnie zwracamy 4 rodzaje zdarzeń:
- **CATEGORY_CREATED** - utworzyliśmy nową kategorię;
- **CATEGORY_RENAMED** - zmieniliśmy nazwę kategorii;
- **CATEGORY_MOVED** - przenieśliśmy kategorię w inne miejsce w drzewie kategorii, zmieniliśmy tym samym wartość parent.id danej kategorii;
- **CATEGORY_DELETED** - usunęliśmy kategorię, nie jest już dostępna. W swoich żądaniach użyj category.id widoczne w polu redirectCategory.

**Przykładowy request:**

```
curl -X GET
‘https://api.allegro.pl/sale/category-events’/
-H ‘Authorization: Bearer {token}’ /
-H ‘Accept: application/vnd.allegro.public.v1+json’
```

**Przykładowy response:**

```
{
...
{
"id": "MTEzMjQzODU3NA", -- ID zdarzenia
"occurredAt": "2021-01-12T15:26:43.891Z", -- czas wystąpienia zdarzenia
"type": "CATEGORY_CREATED", -- typ zdarzenia
"category": { -- dane kategorii, której dotyczy
zdarzenie
"id": "165", -- ID kategorii
"name": "Smartphones and Cell Phones", -- nazwa kategorii
"parent": {
"id": "4" -- ID kategorii nadrzędnej
},
"leaf": false -- czy dana kategoria jest kategorią
najniższego rzędu
}
}
...
}

```

- [GET /sale/category-parameters-scheduled-changes](https://developer.allegro.pl/documentation/#operation/getCategoryParametersScheduledChangesUsingGET_1) - sprawdź zmiany w parametrach, które zaplanowaliśmy na najbliższe 3 miesiące. Domyślnie w odpowiedzi otrzymasz listę 100 najwcześniej zaplanowanych zmian. Na tę chwilę zwracamy tylko jeden rodzaj zmiany - **REQUIREMENT_CHANGE** (dany parametr oznaczymy jako wymagany).

**Uwaga!** W wyjątkowych sytuacjach możemy zdecydować, aby nie wdrażać wybranych zaplanowanych zmian - np. jeżeli zrezygnujemy z oznaczenia danego parametru jako obowiązkowy. W takiej sytuacji dane zdarzenie usuniemy z odpowiedzi.

Możesz także wyfiltrować wyniki na podstawie daty, kiedy zaplanowaliśmy zmianę. Skorzystaj z poniższych filtrów, gdy chcesz sprawdzić, jakie zmiany zaplanowaliśmy w ostatnim czasie:

- **scheduledAt.gte** - najwcześniejsza data, kiedy zaplanowaliśmy zmianę,
- **scheduledAt.lte** - najpóźniejsza data, kiedy zaplanowaliśmy zmianę.

np. żeby sprawdzić, jakie zmiany zaplanowaliśmy do dzisiaj, użyj żądania GET /sale/category-parameters-scheduled-changes?scheduledAt.lte=2021-01-13T23:59:59

Jeżeli chcesz sprawdzić, które parametry oznaczymy jako obowiązkowe w najbliższym czasie, użyj filtrów:
- **scheduledFor.gte** - najwcześniejsza data planowanego uobowiązkowienia,
- **scheduledFor.lte** - najpóźniejsza data planowanego uobowiązkowienia, nie może być większa niż 3 miesiące od bieżącej daty.

np. żeby sprawdzić, które parametry oznaczymy jako obowiązkowe do końca lutego 2021, musisz sformułować żądanie GET /sale/category-parameters-scheduled-changes?scheduledFor.lte=2021-02-28T23:59:59Z.

**Przykładowy request:**

```
curl -X GET
‘https://api.allegro.pl/sale/category-parameters-scheduled-changes’/
-H ‘Authorization: Bearer {token}’ /
-H ‘Accept: application/vnd.allegro.public.v1+json’

```

**Przykładowy response:**

```
{
...
{
"scheduledAt": "2021-01-12T15:26:43.891Z", -- data z przeszłości, kiedy
zaplanowaliśmy zmianę
"scheduledFor": "2021-02-14T15:26:43.891Z", -- data z przyszłości, na kiedy
planujemy wdrożyć zmianę
"type": "REQUIREMENT_CHANGE", -- rodzaj zmiany
"category": {
"id": "165" -- ID kategorii, w której znajduje się
parametr, którego dotyczy zmiana
},
"parameter": {
"id": "11323" -- ID parametru, którego dotyczy
zmiana
}
}

}
```
Więcej informacji o nowych zasobach znajdziesz w [naszym poradniku](https://developer.allegro.pl/my_offers/#kategorie-i-parametry).

-----

Today we have introduced two new resources, which allow you to follow changes in categories and parameters on our platform:

- [GET /sale/category-events](https://developer.allegro.pl/documentation/#operation/getCategoryEventsUsingGET_1) - check changes in categories that took place in the last 3 months. In response, we will return by default 100 oldest events. Using parameter **from** and **ID of given event** you can retrieve another portion of data. At present we support the four types of events:

- **CATEGORY_CREATED** - new category was created;
- **CATEGORY_RENAMED** - category name has been changed;
- **CATEGORY_MOVED** - the category has been moved to a different place in the category tree, category parent.id field is changed;
- **CATEGORY_DELETED** - category is no longer available, category from redirectCategory field should be used instead.

**Sample request:**

```
curl -X GET
‘https://api.allegro.pl/sale/category-events’/
-H ‘Authorization: Bearer {token}’ /
-H ‘Accept: application/vnd.allegro.public.v1+json’
```

**Sample response:**

```
{
...
{
"id": "MTEzMjQzODU3NA", -- event ID
"occurredAt": "2021-01-12T15:26:43.891Z", -- date at which event occurred
"type": "CATEGORY_CREATED", -- event type
"category": { -- category data concerned by the
event
"id": "165", -- category ID
"name": "Smartphones and Cell Phones", -- category name
"parent": {
"id": "4" -- ID of a parent category
},
"leaf": false -- whether the category is
of the lowest tier
}
}
...
}

```

- [GET /sale/category-parameters-scheduled-changes](https://developer.allegro.pl/documentation/#operation/getCategoryParametersScheduledChangesUsingGET_1) - check planned changes in parameters for the next 3 months. In response, you will receive by default a list of the earliest 100 scheduled changes. At present, we support only one type of change - **REQUIREMENT_CHANGE** (the given parameter will be marked as required).

**Note!** Sometimes, the returned events may finally not happen in the future, e.g. if we resign from marking a given parameter as required. In this case, we will remove the event from the response.

You can also filter your results by date at which change was scheduled. Use the following filters when you want to check what changes we have planned recently:

- **scheduledAt.gte** - the earliest date on which the change was scheduled,
- **scheduledAt.lte** - the latest date on which the change was scheduled.

e.g. to check which changes were scheduled till today, you need to make the following request: GET /sale/category-parameters-scheduled-changes?scheduledAt.lte=2021-01-13T23:59:59

If you want to check which parameters we will mark as required in the near future, use filters:
- **scheduledFor.gte** - the earliest date on which the parameter will be marked as mandatory,
- **scheduledFor.lte** - the latest date, on which the parameter will be marked as mandatory. Should be less than 3 months from the current date.

e.g. to check which parameters will become mandatory by the end of February 2021, you need to make the following request: GET /sale/category-parameters-scheduled-changes?scheduledFor.lte=2021-02-28T23:59:59Z.

**Sample request:**

```
curl -X GET
‘https://api.allegro.pl/sale/category-parameters-scheduled-changes’/
-H ‘Authorization: Bearer {token}’ /
-H ‘Accept: application/vnd.allegro.public.v1+json’

```

**Sample response:**

```
{
...
{
"scheduledAt": "2021-01-12T15:26:43.891Z", -- date in the past when the change
was scheduled
"scheduledFor": "2021-02-14T15:26:43.891Z", -- date from the future when we plan to
implement the change
"type": "REQUIREMENT_CHANGE", -- type of change
"category": {
"id": "165" -- category ID in which related
parameter is located
},
"parameter": {
"id": "11323" -- parameter ID affected by the change
}
}

}
```

You can find more information about the new resources in [our guide](https://developer.allegro.pl/en/my_offers/#categories-and-parameters).

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。