I created an App password according to these directions.
https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html
I have also followed the documentation for updating snippets using my App password for the credentials.
https://developer.atlassian.com/bitbucket/api/2/reference/resource/snippets#post
For some reason I always get a 403 "This endpoint does not support token-based authentication" error. Yet I can create snippets just fine by authenticating with the App password mechanism. So why can I not update snippets the exact same way?
I can't find anything in the document for App passwords that says that they only work for certain endpoints of the API. In fact, it very specifically suggests it should work within the scope of the entire API.
Hello @sorcerykid,
Thanks for reaching out and welcome to the Community!
The endpoint you linked is to create a snippet, the one to update a snippet is this: /2.0/snippets/{workspace}/{encoded_id} However, I believe you actually tried the right one, just mentioned the wrong link.
What I think you faced is the wrong example in the PUT endpoint description: the method there is specified as POST whereas it should be PUT. I just confirmed this works for me:
curl -X PUT -u dpenkin:<app_password> -H "Content-Type: application/json" https://api.bitbucket.org/2.0/snippets/dpenkin/n79pb6 -d '{"title": "New snippet title"}'
If I use POST, I get the same error you mentioned (which also looks confusing, but that's a separate task for me to look into).
So I believe you just need to change POST to PUT, and it'll work.
Hope this helps. Let me know that worked.
Cheers,
Daniil
Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!
Start here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.