"Duplicate add-on ID found" when posting update via API

I followed the documentation at https://addons-server.readthedocs.io/en/latest/topics/api/signing.html#upload-version and tried to post an update to my extension via curl:

curl "https://addons.mozilla.org/api/v5/addons/2913c416-cda7-4b3d-aef0-f71995b8a05f/versions/0.1.2/" -g -XPUT --form "upload=@obj/PinyinWeb.xpi" -H "Authorization: JWT $Auth"

and I get

{"error":"Duplicate add-on ID found."}

Searching the Web for this message brings up discussions where developers accidentally tried to create a new extension instead of update an existing one, but I was unable to find anything about this happening from the API (it was always to do with the Web front-end).

Is the documentation correct? Have I misunderstood it? What exactly do I need to change so that my curl command uploads a new version of an existing add-on? Thanks.

Hi @referencedexpressions, what’s the name of the add-on you are trying to update? We can look into this.

Sorry for the double-post, @referencedexpressions – one possibility here is that you need to add the brackets to the URL. Try https://addons.mozilla.org/api/v5/addons/{2913c416-cda7-4b3d-aef0-f71995b8a05f}/versions/0.1.2/ and see if that works?

If it doesn’t, we’ll open up an issue.

Edited to add: Had to edit this multiple times due to poor copy/paste/checking for correctness skills. :sweat_smile:

Thanks Caitlin! Adding the braces made it work.

1 Like

thanks for the awesome information.