allegro / allegro/allegro-api

[NEWS] Umożliwiamy wyszukiwanie i pobieranie danych produktów w różnych językach / We allow you to search and download product data in different languages

オープン
#6,517 コメント 0 件 リアクション 0 件 担当者 1 名 @MartaNowaczyk が担当を希望しています GitHub で見る
Marketplaces News
主要言語
言語のデータがありません
スター
244
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

W przyszłym roku sprzedający będą mogli [wyświetlać oferty w zagranicznych serwisach platformy Allegro](https://developer.allegro.pl/news/zmiany-w-wystawianiu-ofert-dodamy-mozliwosc-wyswietlania-ofert-w-zagranicznych-domenach-serwisu-allegro-VLm1P0KVlhd), dlatego już teraz udostępniamy nowy parametr **"language",** dzięki czemu wyszukasz i pobierzesz produkty w języku, który wskażesz.

**Jakich zasobów dotyczy zmiana?**

- [GET /sale/products](https://developer.allegro.pl/documentation/#operation/getSaleProducts) - wyszukaj produkt,
- [GET /sale/products/{productId}](https://developer.allegro.pl/documentation/#operation/getSaleProduct) - pobierz informacje o produkcie.

**Co zmieniliśmy?**
1. Dodaliśmy możliwość wyszukiwania produktów w różnych językach:

- dla **GET /sale/products?phrase="ps5"&language=cs-CZ** zwrócimy listę produktów znalezionych dla szukanej frazy we wskazanym języku w parametrze **"language"**. Na tym etapie wspieramy wyszukiwanie w języku czeskim.

2. Udostępniliśmy pobranie danych produktu w wersji językowej wskazanej w parametrze **"language"**:

- dla **GET /sale/products/{productId}?language=cs-CZ** zwrócimy dane produktu w języku czeskim. Dostępne języki znajdziesz w [dokumentacji](https://developer.allegro.pl/documentation/#operation/getSaleProduct).
- jeśli nie mamy jeszcze produktu przetłumaczonego na wskazany język, zwrócimy **błąd ze statusem 404** "ProductLanguageVersionUnavailableException" z komunikatem w języku zgodnym z wartością przekazaną w nagłówku **"Accept-Language"**. Jeśli nie podasz wartości dla **"Accept-Language"**, domyślnie zwrócimy komunikat w języku polskim.

3. Jeśli nie podasz wartości dla parametru **"language"**, będziemy bazować na wartości z nagłówka **"Accept-Language"**, dlatego musisz zadbać o to by parametr **"language"** był uwzględniony w zapytaniu. Gdy podasz parametr **"language"**, to **"Accept-Language"** będzie określał wyłącznie język zwracanych komunikatów błędów. Jeśli nie podasz wartości dla **"Accept-Language"**, domyślnie zwrócimy dane produktu w języku polskim. Np. możesz zapytać o produkt z parametrem language=cs-CZ i Accept-Language=en-US, wtedy dane produktu otrzymasz w języku czeskim, a komunikaty błędów w języku angielskim.

4. Wprowadzamy walidację dla języka w nagłówku **"Accept-Language"** oraz dla parametru **"language"**. W przypadku, gdy wprowadzisz nieobsługiwany język, zwrócimy **błąd ze statusem 422**.

---
Next year it will be possible to [display offers in foreign marketplaces of the Allegro platform](https://en.magazyn.allegro.pl/208732-allegro-starts-to-consolidate-mall-group-and-wedo-and-accelerates-top-line-growth-in-q2-as-it-readies-for-tougher-economic-conditions-ahead), so we have already added a new **"language"** parameter, which allows you to search and download products in the indicated language.

**What resources are affected by the change?**

- [GET /sale/products](https://developer.allegro.pl/documentation/#operation/getSaleProducts) - get search products results,
- [GET /sale/products/{productId}](https://developer.allegro.pl/documentation/#operation/getSaleProduct) - get all data of the particular product.

**What have we changed?**

1. We added the possibility to search for products in different languages:

- for **GET /sale/products?phrase="ps5"&language=cs-CZ** will return a list of products found for the search phrase in the indicated language in the **"language"** parameter. At this stage, we support the search in Czech.

2. We have made it possible to retrieve product data in the language version indicated in the **"language"** parameter:

- for **GET /sale/products/{productId}?language=cs-CZ** we will return product data in Czech. You can find the available languages in the [documentation](https://developer.allegro.pl/documentation/#operation/getSaleProduct).
- if we do not have the product translated into the indicated language, we will return an **error with status 404** "ProductLanguageVersionUnavailableException" with a message in the language that matches the value passed in the **"Accept-Language"** header. If you do not provide a value for **"Accept-Language"**, a message in Polish will be returned by default.

3. If you do not provide a value for the **"language"** parameter, we will use the value from the **"Accept-Language"** header, so you must ensure that the **"language"** parameter is included in the request. When you specify the **"language"** parameter, **"Accept-Language"** will only specify the language of the returned error messages. If you do not provide a value for **"Accept-Language"**, it will return product data in Polish by default. For example, you can query a product with the parameter language=cs-CZ and Accept-Language=en-US, in which case you will get the product data in Czech and the error messages in English.

5. We have added validation for the language in the **"Accept-Language"** header and for the **"language"** parameter. If you enter an unsupported language, we will return an **error with status 422**.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。