You can set permissions for files and folders in the Document Manager (DM) by way of the restful web services.
Setting permissions to folders and documents in the DM to users or groups through REST Services involves one of the following:
- Granting explicit permissions (calling out a file or folder, specifying user or group name, and granting permissions to those users or groups)
- Inheriting permissions from a parent folder into child files or folders
- Applying (pushing) permissions from a parent folder to sub-folders or files
- Remove users or groups from having permissions to files or folders in the DM through REST Services
- Get permissions on files or folders using REST Services
Authorization
Every V1 REST services includes JWT token in the Authorization header. The integration username and password which can be created in Unifier under Company Workspaces > User Administration > Integration User are required to create this token. Make a GET request to "/ws/rest/service/v1/login
" service with integration username and password as Basic authorization.
If the call is successful with 200 response code, then the response will contain the JWT token and the expiry date (The token is valid for 6 months from issuance).
The 401 status code will be returned when the username/password combination is incorrect, the User is not an integration user, or when the User is not active.
Sample response
{
"expiryDate": "2019/01/10 12:00 AM",
"status": 200,
"token": "eyJ0eXAiOiJEQiJ9.eyJ1c2VybmFtZSI6IiQkaW50ZWdyYXRpb25icCJ9.2F17ECA4-F553-DF21-BD3F-389AE3680675C80772B0EBF7BAD220BF36BA611BB6A5"
}
All Rest Services must have the following set in the Header.
Header Sample
Key | Value |
---|---|
Authorization | Bearer eyJ0eXAiOiJEQiJ9.eyJ1c2VybmFtZSI6IiQkaW50ZWdyYXRpb25icCJ9.2F17ECA4-F553-DF21-BD3F-389AE3680675C80772B0EBF7BAD220BF36BA611BB6A5 |
Note: The same authorization token can be re-used for subsequent Rest Service requests, until the expiry date.