I'm unable to successfully update a repository variable and not sure why it's not working.
I've been able to get all the necessary IDs and am making the following curl request:
curl -X PUT "https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pipelines_config/variables/{variable_uuid}" -H 'Content-Type: application/json' -d '{"value":"{value}","key":"{name}"}'
from this I get:
{"type": "error", "error": {"message": "Resource not found"}}
Does anyone have any ideas what's missing as I've tried changing everything I can think of but with no luck
Hi, @Will Vachon! Welcome to the community!
I tested this on my side and was able to update the repository variable using this curl request. These are the steps I have followed:
curl -X GET -u user_name:password https://api.bitbucket.org/2.0/repositories/{workspaceID}/{repository_name}/pipelines_config/variables/
curl -X PUT -u user_name:password "https://api.bitbucket.org/2.0/repositories/{workspaceID}/{repository_name}/pipelines_config/variables/%7B{variable_uuid}%7D" -H 'Content-Type: application/json' -d '{"value":"value_20","key":"key_20"}'
Could you please share the exact requests you have run to update your variables? With this information, I can further investigate what could be happening here.
Thank you!
Kind regards,
Caroline
Hey @Caroline R
So turns out I was missing the username:password auth and works fine with that, thanks!
Is this required or is there any other form or authenticating this, I'm wanting to set this up within a pipeline script & would be preferable if it wasn't linked to a specific user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, @Will Vachon!
I'm glad to know this is working fine now! :)
Answering your question, API calls will always require a password to authenticate.
Kind regards,
Caroline
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.