I'm trying to return a simplified list of all of our repos via API. When using the unmodified endpoint (https://api.bitbucket.org/2.0/repositories/{workspace}) I get something that looks like this:
{
"pagelen": 10,
"size": 874,
"values": [
{
"scm": "git",
"has_wiki": false,
"links": {
"watchers": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/watchers"
},
"branches": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/refs/branches"
},
"tags": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/refs/tags"
},
"commits": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/commits"
},
"clone": [
{
"href": "https://myuser@bitbucket.org/myworkspace/our_services.git",
"name": "https"
},
{
"href": "git@bitbucket.org:myworkspace/our_services.git",
"name": "ssh"
}
],
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services"
},
"source": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/src"
},
"html": {
"href": "https://bitbucket.org/myworkspace/our_services"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/{4fe5ecee-f5cb-46c5-bbc8-900cb85ef9fb}?ts=default"
},
"hooks": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/hooks"
},
"forks": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/forks"
},
"downloads": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/downloads"
},
"pullrequests": {
"href": "https://api.bitbucket.org/2.0/repositories/myworkspace/our_services/pullrequests"
}
},
"created_on": "2019-02-05T23:47:10.618606+00:00",
"full_name": "myworkspace/our_services",
"owner": {
"username": "myworkspace/our_services",
"display_name": "My Company",
"type": "team",
"uuid": "{uuid}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/custom_url"
},
"html": {
"href": "https://bitbucket.org/most_custom_url"
},
"avatar": {
"href": "https://bitbucket.org/account/myworkspace/avatar/"
}
}
},
"size": 7392916,
"uuid": "{uuid}",
"type": "repository",
"website": "",
"override_settings": {
"branching_model": false,
"default_merge_strategy": false,
"branch_restrictions": false
},
"description": "API codebase",
"has_issues": false,
"slug": "mycompany_services",
"is_private": true,
"name": "mycompany_services",
"language": "",
"fork_policy": "no_public_forks",
"project": {
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/myworkspace/projects/WEB"
},
"html": {
"href": "https://bitbucket.org/myworkspace/workspace/projects/WEB"
},
"avatar": {
"href": "https://bitbucket.org/account/user/myworkspace/projects/WEB/avatar/32?ts=1547489822"
}
},
"type": "project",
"name": "Website",
"key": "WEB",
"uuid": "{uuid}"
},
"mainbranch": {
"type": "branch",
"name": "master"
},
"workspace": {
"slug": "myworkspace",
"type": "workspace",
"name": "My Company,
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/myworkspace"
},
"html": {
"href": "https://bitbucket.org/myworkspace/"
},
"avatar": {
"href": "https://bitbucket.org/workspaces/myworkspace/avatar/?ts=1587659968"
}
},
"uuid": "{uuid}"
},
"updated_on": "2022-02-09T04:48:15.052710+00:00"
}
}
That's just a single repo; we have over 800. All I really want from this is the full_name value.
The API's partial-response documentation
indicates that there are three ways to get a partial response: remove specific fields, add additional fields, or return only specific fields. That last one is what I want, but I can't figure out how to do it.
There are too many fields to use the ?fields=-links (or whatever field name) syntax, but the only example they have of "return only specific fields" is a json array, which has both field names and values. I don't want to filter things based on values; I want all repos returned, but only the single piece of info from each repo.
Can anyone help me out? I'm testing it in Postman; here's what I've tried so far. All of them return the same full response as shown above. (The obscured part of the URL is our workspace name.)


