When calling the API v2, you can use smart IDs to pass your SSO IDs into the API as parameters. However, what if you want to get your SSO IDs out of the API? In this case, you can use the ssoID
expand parameter on API endpoints.
- Here's how it works. Anytime you see an expand parameter that involves a user, you can specify another expand parameter by appending
.ssoID
to the end.
⭐️ EXAMPLE: I see that the GET /discussions
endpoint has an insertUser
expand parameter. I can also specify insertUser.ssoID
to get that user's SSO ID. The call would look like this:
GET https://example.com/api/v2/discussions?expand=insertUser,insertUser.ssoID
This would return an API result like this:
[
{
"discussionID": 123,
"name": "Some discussion title",
...,
"insertUser": {
"userID": 234,
"name": "username",
"photoUrl": "https://example.com/avatar.jpg",
"dateLastActive": "2020-05-05T12:55:33.304Z",
"ssoID": "<your site's ID here>"
}
},
...
]
What SSO ID is expanded?
In order to have an SSO ID expanded, you must have a default SSO method selected. The IDs from the default SSO provider are used.
SSO ID permissions
SSO IDs require permission to view. To manage the level of permissions for SSO IDs:
- Access the Dashboard.
- Navigate to Settings > Membership > Roles & Permissions.
- Click the Advanced Settings button at the top right (to the left of the Add Role button).
- Select a Role in the API SSO Expand Permission dropdown.
- Click Save.