There appears to be a undocumented api that lets you add a user to a space and it works with api tokens. For inviting a guest you can use the Jira api to add them to the guest group. for adding them to a space you can use http request below to invite user 12345:12345678901234567890 to the space with the key DEMO.
curl --request POST \
--url 'https://adminuser%40domain.com:apitoken@site.atlassian.net/cgraphql?q=ResetExCoSpacePermissionsMutation' \
--data '[
{
"operationName": "ResetExCoSpacePermissionsMutation",
"variables": {
"accountId": "12345:12345678901234567890",
"spaceKey": "DEMO"
},
"query": "mutation ResetExCoSpacePermissionsMutation($accountId: String!, $spaceKey: String) {\n resetExCoSpacePermissions(input:
{accountId: $accountId, spaceKey: $spaceKey}
) {\n status\n __typename\n }\n}\n"
}
]'
There is another request that lets you list the guest users on the site and their space associations there is a filter to limit it to users that don't have an assigned space.
curl --request POST \
--url 'https://adminuser%40domain.com:apitoken@site.atlassian.net/cgraphql?q=WebItemLocationQuery%3Asystem.help%2Fpages' \
--data '[
{
"operationName": "GuestDataQuery",
"variables": {
"includeSpacesAssigned": false,
"first": 25,
"offset": 0,
"spaceIds": [],
"spaceAssignmentType": "UNASSIGNED"
},
"query": "query GuestDataQuery($first: Int, $offset: Int, $name: String, $email: String, $spaceIds: [ID], $spaceAssignmentType: SpaceAssignmentType, $includeSpacesAssigned: Boolean = true, $groupIds: [String]) {\n externalCollaboratorsByCriteria(\n first: $first\n offset: $offset\n name: $name\n email: $email\n spaceIds: $spaceIds\n spaceAssignmentType: $spaceAssignmentType\n groupIds: $groupIds\n ) {\n count\n nodes {\n accountId\n displayName\n email\n profilePicture
{\n path\n __typename\n }
\n spacesAssigned @include(if: $includeSpacesAssigned) {\n nodes {\n id\n key\n name\n icon
{\n path\n __typename\n }
\n {}typename\n }\n{} _typename\n }\n _typename\n }\n pageInfo
{\n hasNextPage\n endCursor\n_ _typename\n }
\n_ _typename\n }\n}\n"
}
]'
We really MUST have a way to provide access to our Knowledge Base in Confluence for customers by domain name. If there is a way to embed access in our web app (asp.net) via an API which could grant view-only access this would be good. We MUST have a way to provide a read-only access to customers without having to manage them individually. We have about 25 domains which are manageable, but a thousands of users are not manageable.
We don't want a work-around or something that is cumbersome to us or to our users. Providing public access does not work for us.