People - Permissions API
People - Permissions API
Section titled “People - Permissions API”- People - Permissions API
- List permissions of a person
- List permissions of a person for a specific account
- List people of account with specific roles
- List people with specific roles of account
- Add roles to a person
- Overwrite the roles of a person
- Revoke roles from a person
- Revoke all roles of an account from a person
- Revoke all roles from a person
- Fields
List permissions of a person
Section titled “List permissions of a person”List all permissions of a person with the given :id .
GET /people/:id/permissionsResponse
Section titled “Response”Status: 200 OK[ { "account": { "id": "pro-product", "name": "Widget International" }, "roles": [ "directory_administrator" ] }, { "account": { "name": "Widget Data Center", "id": "dc" }, "roles": [ "specialist", "service_desk_analyst", "service_desk_manager", "knowledge_manager", "problem_manager", "workflow_manager", "release_manager", "project_manager", "service_level_manager", "configuration_manager", "account_administrator", "account_owner" ] }, { "account": { "name": "Widget North America", "id": "wna" }, "roles": [ "account_administrator" ] }, { "account": { "name": "Widget Europe", "id": "weu" }, "roles": [ "account_administrator" ] }]The response contains these fields by default.
List permissions of a person for a specific account
Section titled “List permissions of a person for a specific account”List all permissions of a person with the given :id for the account with the given :accountID .
GET /people/:id/permissions/:accountIDResponse
Section titled “Response”Status: 200 OK{ "account": { "name": "Widget Data Center", "id": "dc" }, "roles": [ "specialist", "service_desk_analyst", "service_desk_manager", "knowledge_manager", "problem_manager", "workflow_manager", "release_manager", "project_manager", "service_level_manager", "configuration_manager", "account_administrator", "account_owner" ]}The response contains these fields by default.
List people of account with specific roles
Section titled “List people of account with specific roles”Returns all the person records that are registered in the account and its directory account, provided that these people have at least one of the specified roles.
GET /people?roles=role1,role2,...Example:
$ curl -H "Authorization: Bearer <oauth-token>" \ -H "account: pro-product" \ -X GET \ "https://api.r-service.tech/v1/people?roles=directory_administrator,directory_auditor"Response
Section titled “Response”The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of people.
List people with specific roles of account
Section titled “List people with specific roles of account”Returns all the person records that have at least one of the specified roles of the account.
GET /people/all_with_roles?roles=role1,role2,...Example:
$ curl -H "Authorization: Bearer <oauth-token>" \ -H "account: dc" \ -X GET \ "https://api.r-service.tech/v1/people/all_with_roles?roles=specialist,problem_manager"Response
Section titled “Response”The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of people.
Add roles to a person
Section titled “Add roles to a person”Adds the specified roles of the account to a person.
POST /people/:id/permissions/:accountID?roles=role1,role2,...Example:
$ curl -H "Authorization: Bearer <oauth-token>" -X POST -H "account: pro-product" "https://api.r-service.tech/v1/people/1234/permissions/dc?roles=specialist,problem_manager"Response
Section titled “Response”The response contains these fields by default.
Overwrite the roles of a person
Section titled “Overwrite the roles of a person”Overwrite the roles that a person has of the account with the specified roles of the account.
PATCH /people/:id/permissions/:accountID?roles=role1,role2,...Example:
$ curl -H "Authorization: Bearer <oauth-token>" -X PATCH -H "account: pro-product" "https://api.r-service.tech/v1/people/1234/permissions/dc?roles=problem_manager,workflow_manager"Response
Section titled “Response”The response contains these fields by default.
Revoke roles from a person
Section titled “Revoke roles from a person”Remove the specified roles of the account from a person.
DELETE /people/:id/permissions/:accountID?roles=role1,role2,...Example:
$ curl -H "Authorization: Bearer <oauth-token>" -X DELETE -H "account: pro-product" "https://api.r-service.tech/v1/people/1234/permissions/dc?roles=problem_manager,workflow_manager"Response
Section titled “Response”Status: 204 No ContentRevoke all roles of an account from a person
Section titled “Revoke all roles of an account from a person”Remove all roles of the specified account from a person.
DELETE /people/:id/permissions/:accountIDExample:
$ curl -H "Authorization: Bearer <oauth-token>" -X DELETE -H "account: pro-product" "https://api.r-service.tech/v1/people/1234/permissions/dc"Response
Section titled “Response”Status: 204 No ContentRevoke all roles from a person
Section titled “Revoke all roles from a person”Remove all roles in all accounts from a person.
DELETE /people/:id/permissionsExample:
$ curl -H "Authorization: Bearer <oauth-token>" -X DELETE -H "account: pro-product" "https://api.r-service.tech/v1/people/1234/permissions"Note:
- You must be administrator in the account of the specified person.
- It is not allowed to remove your own permissions.
Response
Section titled “Response”Status: 204 No ContentFields
Section titled “Fields”account
Required reference to Account — The account for which the person has permissions
roles
Required array of string max(21) — The roles the person has within the account
key_contactauditorfinancial_managerdirectory_auditor(for directory accounts only)specialistservice_desk_analystservice_desk_managerknowledge_managerproblem_managerworkflow_managerrelease_managerproject_managerservice_level_managerconfiguration_manageraccount_designeraccount_administratordirectory_designer(for directory accounts only)directory_administrator(for directory accounts only)workflow_automator_auditor(for R-Service Workflow Automator enabled accounts only)workflow_automator_specialist(for R-Service Workflow Automator enabled accounts only)account_owner