Different results for get spaces

Ok, I am hoping this has been addressed, but I can’t seem to find it in the forum. So, I have a Confluence cloud app and I am trying to get all the spaces up to the 1000 limit. This works:

  • /rest/api/space?limit=1000&expand=icon

I get all (114) spaces returned that is in my dev instance but I don’t get the description or categories returned. However, when I do to the following:

  • /rest/api/space?limit=1000&expand=icon,description.view,metadata.labels

I get the description and categories, but it limits the returned results to (100) instead of the full (114). I have tested description.view and metadata.labels by themselves and know for a fact that they cause this behavior individually.

Has anyone else ran into this issue? If yes, how did you resolve it?

I can remove the metadata.labels and description.view and just not display this information as it is more important that the user sees all of the spaces (that they have access to) than it is to see this information. However, I feel the more information I can provide to the user the better the app will be received (and the more professional it looks & feels).

Perhaps just set the limit to 100 and then look in the response for the _links section. If it contains a next entry, use that url to get the next set of up to 100 pages. Repeat until there’s no next link in the response.

Thanks for the quick response and excellent catch—I didn’t even see it b/c I just finished a Jira cloud app and that wasn’t necessary so I totally wasn’t paying attention to that.

I believe that will get me what I need.

1 Like

@BobBergman,

Wanted to give you a quick thanks! With your feedback I was able to resolve the issue and the app will now retrieve all spaces (up to the 1000 limit Atlassian has imposed) with descriptions and labels/space categories. :slight_smile:

2 Likes