Publish to Chrome Webstore using the items.Publish API and cURL

552 Views Asked by At

We are developing a Chrome Extension and, as part of the release build, we want to publish it to the Chrome Webstore for testing.

We are using cURL to send the http requests.

Using the information in : https://developer.chrome.com/webstore/using_webstore_api we have successfully updated the store, but I am seeing an odd error when trying to publish it using the information in "Publishing an item to trusted testers" in the above link.

The command line looks like this as suggested in the link above:

curl -H "Authorization: Bearer %refresh_token%" -H "x-goog-api-version: 2" -H "Content-Length: 0" -H "publishTarget: trustedTesters" -X POST -v https://www.googleapis.com/chromewebstore/v1.1/items/%app_id%/publish

When I run this I get an error back stating that the publish condition is not met. The error message states that we should set publish_to_trusted_testers=true, but I can find no documentation suggesting how or where I should set this.

Note that access tokens are working OK, and the PUT command to upload the new extension is also successful.

Any advice would be gratefully accepted.

Jon

2

There are 2 best solutions below

0
On

I tried url query and it succeeded:

  curl \
  enter code here-H "Authorization: Bearer $ACCESS_TOKEN"  \
  -H "x-goog-api-version: 2" \
  -H "Content-Length: 0" \
  -X POST \
  -v \
  https://www.googleapis.com/chromewebstore/v1.1/items/$APP_ID/publish?publishTarget=trustedTesters
0
On

https://developer.chrome.com/webstore/webstore_api/items/publish#parameters

The docs on https://developer.chrome.com/webstore/using_webstore_api don't currently point to the correct use of the api, but the publish docs are correct.