Hi, I am trying to create a user group using bitbucket api.
But failing because of naming exceptions.
Bitbucket Version: 5.5.4.
Command Used:
curl -X POST https://bitbucketurl/rest/api/1.0/admin/groups -v -u <username>:<password> -H 'Content-type: application/json' -d '{"name":"Test", "deletable": true}' --insecure
Error:
{"errors":[{"context":null,"message":"Please enter a non-empty group name that is 255 characters or less.","exceptionName":"com.atlassian.bitbucket.InvalidNameException"}]}
Can someone tell me what is wrong in this
Hi ArjunKumar,
The API endpoint is expecting the "?NAME" flag at the end of the URL in your call. If you append this, you can then see the change in behavior. Please see my example below.
curl -u <admin_user> -v -d "{"name":"Test2", "deletable": true}" -H "Content-Type: application/json" "https://bitbucket.mycompany.com/rest/api/1.0/admin/groups?name=Test2"
Best Regards,
Michael
Hi Michael,
Thanks for the response. When i tried in the way you said it showing the error "XSRF check failed"
What to do for this. Can you please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Michael, its working fine no issues :)
Thanks for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Arjun,
I'm sorry, I forgot to point out the sample base_url in my example. For anyone else encountering this, it should be simply addressed by updating the "https://bitbucket.mycompany.com" at the start of the URL used. Simply adjust this to match your environment, for example: "http://localhost:7990/"
I hope this helps!
Best Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.