Forums

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

Creating Pull Request on Behalf of Team Members via API

Drew
Contributor
July 12, 2018

I've been attempting to create a pull request on behalf of our team members in an autonomous manner.

I'm able to create the pull request if I authenticate as the particular user with their username and password, but if I attempt to provide an alternative author username, per the swagger documentation, the field is ignored and only the administrator account is permitted.

Is there an authentication mechanism in place, short of having every team member complete the OAUTH procedure (Not practical), in which I am able to perform the desired API call and specify an author?

Sample call, which succeeds, but uses the username specified in the auth header. I have not yet attempted to setup authentication with OAUTH: 

curl -X POST -H "Content-Type: application/json" -u ...:... https://bitbucket.org/api/2.0/repositories/.../.../pullrequests -d '{
"title": "...",
"description": "...",
"source":
{
"branch":
{
"name": "..."
},
"repository":
{
"full_name": ".../..."
}
},
"destination":
{
"branch":
{
"name": "..."
}
},
"close_source_branch": false,
"author": {
"type": "user",
"username": "...",
"display_name": "...",
"account_id": "...:...-...-...-...-...",
"links":
{
"self":
{
"href": "https://bitbucket.org/!api/2.0/users/..."
},
"html":
{
"href": "https://bitbucket.org/.../"
},
"avatar":
{
"href": "https://bitbucket.org/account/.../avatar/"
}
},
"type": "user",
"uuid": "{...}"
}
}'

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events