迁移数据源管理

您可以使用数据源向 Google 上传商品。自动化数据源可让您更轻松地向 Google 发送商品数据。如需了解详情,请参阅 Merchant Data sources API 概览

以下是 Content API for Shopping 中的请求与 Merchant Data sources API 中的请求比较示例:

Content API for Shopping 商家数据源 API
网址 https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds https://merchantapi.googleapis.com/datasources/v1beta/{parent}/dataSources
标识符 {id} {name}

方法

下面对比了 Content API for Shopping 和 Merchant Data sources API 中的数据 Feed 方法:

方法 Content API for Shopping 商家数据源 API
customBatch 不支持
insert
get
update
delete
list
fetchNow

标识符

与其他资源相反,数据源的名称无法通过 Content API ID 构建,因为 ID 值已更改。您可以调用 list 方法获取数据源的新 ID。

或者,您也可以调用 accounts.products.get 方法并从 product 资源获取新的数据源 ID。

方法

以下是 Merchant Data sources API 中数据 Feed 的变更:

方法 Content API for Shopping 中的网址 Merchant Data sources API 中的网址 Content API for Shopping 中的标识符 Merchant Data sources API 中的标识符 说明
create POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds POST https://merchantapi.googleapis.com/datasources/v1beta/{parent=accounts/*}/dataSources {merchantId} {parent} 在 Content API for Shopping 中,唯一的 create 方案是创建主要文件 Feed。Merchant Data sources API 中新引入了所有其他 create 场景。
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}/datafeeds/{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}/datafeeds/{datafeedId} {name=accounts/*/dataSources/*}