The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Bitbucket Rest API

lovisharma
April 2, 2019

error.PNGHi Team, 

 

Getting the below error when ever am posting any content on rest API.

The same error comes when i post using curl too.

Need your urgent help in resolving this.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 2, 2019

Hi @lovisharma ,

Perhaps you should review your REST API call https://source.bhp.com/rest/api/1.0/api/1.0/admin/users?... as there is a duplicate (api/1.0), instead, please try https://source.bhp.com/rest/api/1.0/admin/users?...

Kind regards,
Rafael

lovisharma
April 2, 2019

Hi Rafael,

https://source.bhp.com/rest/api/1.0/api/1.0/admin/users?

This URL which is coming from the REST API BROWSER. Even if am using CURL for posting the content on https://source.bhp.com/rest/api/1.0/admin/users? (its giving me the same error.image.png

In every URL api/1.0/api/1.0 is repeating.

Could you please help.

Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 3, 2019

Hi @lovisharma ,

What is the Bitbucket Server version and REST API Browser add-on you are running?

The /api/1.0 duplicate might be caused by a redirect on your web proxy, incompatible plugin or something else. As you can see not only from https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-rest.html but also from screenshot below the duplicate seems to happen only on your environment.

bitbucket.rest.api.png

The following cURL command should create a user "curl" in your Bitbucket instance:

# replace {USERNAME}, with user that can create users in Bitbucket
# you will be prompted to type in user's password

curl -k -v -u {USERNAME} \
-H 'Content-type: application/json' \
-H 'Accept: application/json' \
-X POST 'https://source.bhp.com/rest/api/1.0/admin/users?name=curl&password=curl&displayName=cURL&emailAddress=curl%40localhost&addToDefaultGroup=true&notify=false'

Could you please run the cURL command from above and share the output, if any?

Kind regards,
Rafael

TAGS
AUG Leaders

Atlassian Community Events