Quản lý nguồn dữ liệu di chuyển

Nguồn dữ liệu cho phép bạn tải sản phẩm lên Google. Nguồn dữ liệu tự động giúp bạn dễ dàng gửi dữ liệu sản phẩm đến Google. Để biết thêm thông tin, hãy xem bài viết Tổng quan về API Nguồn dữ liệu của người bán.

Dưới đây là ví dụ so sánh mẫu giữa các yêu cầu trong Content API for Shopping với API Nguồn dữ liệu của người bán:

Content API for Shopping API Nguồn dữ liệu người bán
URL https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds https://merchantapi.googleapis.com/datasources/v1beta/{parent}/dataSources
Giá trị nhận dạng {id} {name}

Phương thức

Dưới đây là phần so sánh các phương thức nguồn cấp dữ liệu trong Content API for Shopping và API nguồn dữ liệu của người bán:

Phương thức Content API for Shopping API Nguồn dữ liệu người bán
customBatch Không
insert
get
update
delete
list
fetchNow

Giá trị nhận dạng

Trái với các tài nguyên khác, tên của nguồn dữ liệu không được tạo từ Content API ID vì các giá trị mã nhận dạng đã thay đổi. Bạn có thể gọi phương thức danh sách để nhận mã nhận dạng mới của các Nguồn dữ liệu.

Ngoài ra, bạn có thể gọi phương thức accounts.products.get và nhận Mã nguồn dữ liệu mới từ tài nguyên product.

Phương thức

Dưới đây là những thay đổi đối với nguồn cấp dữ liệu trong API Nguồn dữ liệu của người bán:

Phương thức URL trong Content API for Shopping URL trong Merchant Data Source API (API Nguồn dữ liệu người bán) Giá trị nhận dạng trong Content API for Shopping Giá trị nhận dạng trong API Nguồn dữ liệu của người bán Nội dung mô tả
create POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/datafeeds POST https://merchantapi.googleapis.com/datasources/v1beta/{parent=accounts/*}/dataSources {merchantId} {parent} Trong Content API for Shopping, trường hợp create duy nhất là tạo nguồn cấp dữ liệu tệp chính. Chúng tôi mới ra mắt tất cả các trường hợp create khác trong API Nguồn dữ liệu người bán.
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 ĐĂNG 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/*}