Źródła danych umożliwiają przesyłanie informacji o produktach do Google. Automatyczne źródła danych ułatwiają przesyłanie danych produktów do Google. Więcej informacji znajdziesz w artykule Omówienie interfejsu API źródeł danych sprzedawcy.
Oto przykładowe porównanie żądań w Content API for Shopping z interfejsem Merchant Data Source API:
Content API for Shopping | Interfejs API źródeł danych sprzedawcy | |
---|---|---|
URL | https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds | https://merchantapi.googleapis.com/datasources/v1beta/{parent}/dataSources |
Identyfikatory | {id} | {name} |
Metody
Oto porównanie metod obsługi plików danych w interfejsie Content API for Shopping i interfejsu Merchant Data Source API:
Metoda | Content API for Shopping | Interfejs API źródeł danych sprzedawcy |
---|---|---|
customBatch |
Tak | Nie |
insert |
Tak | Tak |
get |
Tak | Tak |
update |
Tak | Tak |
delete |
Tak | Tak |
list |
Tak | Tak |
fetchNow |
Tak | Tak |
Identyfikatory
W przeciwieństwie do innych zasobów nazwy źródła danych nie można utworzyć na podstawie identyfikatora Content API, ponieważ wartości identyfikatora uległy zmianie. Możesz wywołać metodę listy, by uzyskać nowe identyfikatory źródeł danych.
Możesz też wywołać metodę accounts.products.get
i pobrać nowy identyfikator źródła danych z zasobu product
.
Metody
Co się zmieniło w przypadku plików danych w interfejsie API źródeł danych sprzedawcy:
Metoda | Adres URL w Content API for Shopping | Adres URL w interfejsie API źródeł danych sprzedawcy | Identyfikator w Content API for Shopping | Identyfikator w interfejsie API źródeł danych sprzedawcy | Opis |
---|---|---|---|---|---|
create |
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds |
POST https://merchantapi.googleapis.com/datasources/v1beta/{parent=accounts/*}/dataSources |
{merchantId} | {parent} |
W Content API for Shopping jedynym sposobem na create jest utworzenie podstawowego pliku danych. Wszystkie pozostałe scenariusze create zostały niedawno wprowadzone w interfejsie API źródeł danych sprzedawcy.
|
update |
PUT https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId} |
PATCH https://merchantapi.googleapis.com/datasources/v1beta/{dataSource.name=accounts/*/dataSources/*} |
{merchantId}/datafeeds/ {datafeedId} |
{dataSource.name=accounts/*/dataSources/*} |
|
delete |
DELETE https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/datafeeds/ {datafeedId} |
DELETE https://merchantapi.googleapis.com/datasources/v1beta/ {name=accounts/*/dataSources/*} |
{merchantId}/pliki danych/{datafeedId} | {name=accounts/*/dataSources/*} | |
get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/datafeeds/ {datafeedId} |
GET https://merchantapi.googleapis.com/datasources/v1beta/ {name=accounts/*/dataSources/*} |
{merchantId}/datafeeds/ {datafeedId} |
{name=accounts/*/dataSources/*} | |
list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId}/datafeeds |
GET https://merchantapi.googleapis.com/datasources/v1beta/ {parent=accounts/*}/dataSources |
{merchantId} | {parent} | |
fetchnow |
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds/{datafeedId}/fetchNow | POST https://merchantapi.googleapis.com/datasources/v1beta/{name=accounts/*/dataSources/*}:fetch | {merchantId}/pliki danych/{datafeedId} | {name=accounts/*/dataSources/*} |