Python Query to List Confluence Cloud Space Admin Permissions by User with REST API

Job ID: 34557559

Budget: $10 – $30 CAD

I'm looking for a python script that takes the input of a Confluence user (email address or uid) and will output a list of Space Key and Space Name for each space where the user has the "administer" "space" permission. Atlassian does not offer an endpoint to make this an easy query.

The only way I can think of to achieve this would be to parse the properties of every single space. Please write in Python and utilizing API token.

The "administer" "space" permission should have the value of 'administer': 'space' for operation.key and operation.target.

Context: https://community.developer.atlassian.com/t/list-of-admins-of-a-defined-space-in-confluence-server-rest-api/24907
Example Permission Request: https://gist.github.com/nedbat/76f19e2af264e7f0bf5743fe659ed911

REST API Docs:
https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#space/%7BspaceKey%7D/property-get
https://developer.atlassian.com/cloud/confluence/rest/intro/
https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-wiki-rest-api-space-spacekey-get

GET /wiki/rest/api/space/{spaceKey}