Collaborate impersonation API
OVERVIEW
The Collaborate API endpoints respond based on the individual users permissions and there is no way with the Collaborate 3.4.x API implementation to call the API endpoint on behalf of another user.
In order to provide this feature we have developed the impersonation API, which the system admin user can call to impersonate another user. This implementation is similar to proxy login functionality available in Collaborate.
This API endpoint allows a system admin, once they have generated their own OAuth token to generate an OAuth token for another user using their email address or user id.
Request URL :
Method : GET
URL :/api/1/admin/impersonate
Parameters | Value | Description |
---|---|---|
userid | int | ID of the user who is to be impersonated. You can either use userid or useremail to represent a user, but do not need to use both parameters at the same time. The URL will be in the format /admin/impersonate?userid={ID of the user} |
useremail | String |
Email address of the user in Collaborate, you can use this parameter or userid parameter to represent a user. The URL should be in the following format /admin/impersonate?useremail={email address of the user} |
Response:
The response will be the OAuth token for the specific user in case of success
<TokenResponse>
<access_token>QNvtELSppDtMtQI6ER5meGa3V29XYmUI</access_token>
<expires_in>3600</expires_in>
<refresh_token>YuchLxFdnEfu8JhnP2QOXjYrBkHs0btxhlOZoXLI63ahiPz4R1o9bU2xzstGeYG9</refresh_token>
<token_type>bearer</token_type>
<useremail>first.last@domain.com</useremail>
</TokenResponse>
The system admin then should be able to call the API using the users token to get the API response on his behalf.
Error response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<link>
https://domain/instancename/api/1/error/272
</link>
<summary>Invalid useremail found, Please provide valid useremail.</summary>
</error>
Jeffrey Le wanted to bring to your attention that you need a system admin account to do impersonation. Are you sure you are using a system admin account? this is a Collaborate business rule to do Impersonation.
Hello, I tried using this API and it's not working. I'm not sure if it's the token or the url but let's check the url first. https://collxxx.xxxxx.com/xxxxx/api/1/admin/impersonate?useremail=xxxxx is this correct? I tried using system admin token but I keep on getting a 401 error. Is there a special way to create the token?
Comments
2 Comments