Updating a product
You can update a product's labels via key-value pairs, such as "style=womens"
or "onSale=true"
, using the following code.
Command-line
To update a product, send aPATCH
request to the following
URI.
- Replace project-id with the id of your Google Cloud project.
- Replace location-id with a valid location identifier. Valid location identifiers are:
us-west1
,us-east1
,europe-west1
, andasia-east1
- Replace product-id with the id for the product to update.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ -H "Content-Type: application/json" \ https://vision.googleapis.com/v1/projects/project-id/locations/location-id/products/product-id -d "{ 'updateMask': { 'paths': ['display_name'] }, 'product': { 'display_name': 'new-display-name' } }"
C#
Go
Java
Node.js
PHP
Python
Ruby