Migrating from version 1 to version 2

New features introduced in version 2:

  • You can now use JSON or XML as the request and response formats.
  • You can now get per-product data quality information from the new productstatuses service.
  • Data quality and destination status information has been moved to the new productstatuses service.
  • OAuth 2.0 Service Accounts can now be used with the API.
  • Inventory-only updates (price and availability) are now available for all products through the inventory service.
  • Request batching is now available for all services, not just products.
  • Account and user management services now work for all accounts, not just MCAs.
  • Libraries and sample code for more languages. We continue to offer Java, PHP, Python, and .NET. We've added Go, JavaScript, Objective-C, and Ruby. There are also specific libraries for Node.js and GWT.

Authentication and root URL

  • OAuth 2.0 is now the only supported authentication method.
  • The OAuth 2.0 scope for the API changes from https://www.googleapis.com/auth/structuredcontent to https://www.googleapis.com/auth/content.
  • The root URL for the API changes from https://content.googleapis.com/content/v1/ to https://www.googleapis.com/content/v2/.

Request and response

  • The default response type is now JSON. To get an XML response you need to add a query string parameter of alt=xml to your API request URLs.
  • Version 1 of the API used Atom Feeds as the data interchange format. In version 2 the XML documents are generic. In particular:
    • In version 1 you were required to use an HTTP Content-Type header of application/atom+xml. In version 2 this should be application/json or application/xml.
    • Neither the request nor response XML documents use any namespaces.
    • In version 1 the root element of a collection was <feed>. In version 2 it is a more specific element such as: <products>, <accounts>, <datafeeds>.
    • Similarly, single resources in version 1 were contained in an <entry> element. In version 2 it is a more specific element such as: <product>, <account>, <datafeed>.

Products

  • Data quality and destination status information has been moved to a new service called productstatuses.
  • It is no longer possible to get performance data from the Content API.
  • Warnings now have their own top-level field and are always returned.
  • atom:id is now id.
  • sc:id is now offer_id.
  • All the fields that are present in version 1 but that are not present in the latest Merchant Center feed specification have been retired:
    • author
    • edition
    • feature
    • featured_product
    • genre
    • manufacturer
    • product_review_average
    • product_review_count
    • quantity
    • year
  • All the fields present in the latest Merchant Center feed specification but not in version 1 have been added:
    • custom_label_0
    • custom_label_1
    • custom_label_2
    • custom_label_3
    • custom_label_4
    • energy_efficiency_class
    • identifer_exists
    • merchant_multipack_quantity
    • online_only
    • unit_pricing_measure
    • unit_pricing_base_measure
  • The Brazil-only field installment and the Japan-only field loyalty_points are first-class fields in version 2. In version 1 they were accepted only as custom attributes.
  • For consistency with product statuses, the former repeated fields excluded_destination, required_destination and validate_destination are now a single repeated field whose elements specify "excluded", "required" or "validate".
  • status='review' in sc:status has been replaced by the presence of the destination in a read-only validated_destination repeated field.
  • sc:attribute and sc:group are now custom_attribute and custom_group.

Managed Accounts

  • The managedaccounts services are split into accounts and accountstatuses.
  • You can fetch and update your primary account, not just sub-accounts.
  • The former content field is no longer used.
  • The link field has been renamed website_url.
  • A new users field provides a list of users associated with the account.

Data Quality

  • The dataquality services are split into the accountstatuses and productstatuses services.
  • policy now has sub-elements destinations and issue_group_references instead of a concatenated list of strings.

Users

  • Users are now managed as part of the accounts service. Manage users by setting the value of the users field of an account.

Data Feeds

  • In version 2 there are no default destinations. You must specify them using the new intended_destination field which replaces the feed_destination field.

Send feedback about...

Content API for Shopping