I am trying to use the BitBucket Cloud API to get information about the repository that a given repository was forked from, but I cannot see a way to do this. Could someone please let me know if this is possible and, if so, how to do it? Thanks in advance for your help.
Community moderators have prevented the ability to post new answers.
Hello @jamiebaggott,
Thanks for reaching out.
This information is returned in parent JSON element of the payload of /2.0/repositories/<account>/<repository> endpoint.
Note that you can use fields parameter to filter down response to only the fields you need, for instance:
{
full_name: "dpenkin/atlaskit-fork",
uuid: "{4437c670-7948-40fa-b3ee-82cc47cf8654}",
parent: {
uuid: "{6380b4e9-6ac5-4dd4-a8e0-65f09cabe4c8}",
full_name: "atlassian/atlaskit-mk-2",
name: "Atlaskit-MK-2"
},
name: "Atlaskit-Fork"
}
Hope this helps.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.