Issues obtaining specific properties of spaces and content via REST API

I am working on a connector to index Confluence content with a search engine. To do that effectively, I want to be able to ensure I have certain properties that I can attach to the documents as they are indexed.

In reviewing the REST API, I haven’t been able to figure out how to get the following information:

“Space description”, “space category”, “page label”.

I was able to find places where there is “description” blocks in API responses. For example:

http:///rest/api/space/{key}/

Returns a section called “_expandable” that includes “description”. So then I thought I could visit:

http:///rest/api/space/{key}?expand=description

When I visit this, I see:

    "description": {
        "_expandable": {
            "view": "",
            "plain": ""
        }
    },

Yet if I view the “Spaces directory”, in the Confluence server, I can see the description.

Any suggestions on how to find the “description”?

I have not been able to find the “space category” either. In researching, it seems as though you need to perform a ‘search’ with the CQL which I was able to do.

I tried this:
http:///rest/api/search?cql=space="{key}"

I found that one of the results was the “space” I was looking for but the response did not include the space category nor the description.

In looking at the response for a “page”, I did not find the “label” anywhere.

I am using Confluence Server 6.x

Thanks for any guidance/tips.

Terry

Hello @TerryChambers

So with our rest api you have to follow the _expandable paths, I have to admit we can improve on the dev experience, but for the time being you can fetch the space data you need by targeting the following endpoint

/rest/api/space/<spaceKey>?expand=description.view,metadata.labels

Thanks, this worked great for getting the “space” category and description.

When I tried the same approach to get the content “label”, I could not find the label value.

I tried

/rest/api/content/{contentId}?expandable=metadata.labels

I do not see the label anywhere.

try rest/api/content/{contentId}?expand=metadata.labels notice expand query parameter not expandable

Yes, that works! Thanks!