Greetings,
I am trying to program a quick detection of a repository under a project and if that repo does not exist create it.
So, I use the API to check for its existence, and upon a 404 I create a POST (with pycurl) to
/rest/api/1.0/projects/PROJECT/repos/toplevel
Where toplevel is an existing repo.
The payload is:
{"name": "newrepo",
"scmID": "git",
"forkable": true}
I then POST this to
/rest/api/1.0/projects/PROJECT/repos/toplevel
Expecting a new repo in toplevel/newpo.
Instead, a new repo is created in my personal area:
(The POST shows me the location)
/rest/api/1.0/projects/~USERNAME/repos/newrepo
I don't understand the redirection.
I have attempted to use this documentation along with examples I've found in these forums.
https://docs.atlassian.com/bitbucket-server/rest/7.7.1/bitbucket-rest.html#idp173