People - Permissions API

List permissions of a person

List all permissions of a person with the given :id.

GET /people/:id/permissions

Response

Status: 200 OK
[
  {
    "account": {
      "id": "widget",
      "name": "Widget International"
    },
    "roles": [
      "directory_administrator"
    ]
  },
  {
    "account": {
      "name": "Widget Data Center",
      "id": "wdc"
    },
    "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

List all permissions of a person with the given :id for the account with the given :accountID.

GET /people/:id/permissions/:accountID

Response

Status: 200 OK
{
  "account": {
    "name": "Widget Data Center",
    "id": "wdc"
  },
  "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

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 "X-4me-Account: widget" \
        -X GET \
        "https://api.4me.com/v1/people?roles=directory_administrator,directory_auditor"

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

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 "X-4me-Account: wdc" \
        -X GET \
        "https://api.4me.com/v1/people/all_with_roles?roles=specialist,problem_manager"

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

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 "X-4me-Account: widget" "https://api.4me.com/v1/people/1234/permissions/wdc?roles=specialist,problem_manager"

Response

The response contains these fields by default.

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 "X-4me-Account: widget" "https://api.4me.com/v1/people/1234/permissions/wdc?roles=problem_manager,workflow_manager"

Response

The response contains these fields by default.

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 "X-4me-Account: widget" "https://api.4me.com/v1/people/1234/permissions/wdc?roles=problem_manager,workflow_manager"

Response

Status: 204 No Content

Revoke all roles of an account from a person

Remove all roles of the specified account from a person.

DELETE /people/:id/permissions/:accountID

Example:

 $ curl -H "Authorization: Bearer <oauth-token>" -X DELETE -H "X-4me-Account: widget" "https://api.4me.com/v1/people/1234/permissions/wdc"

Response

Status: 204 No Content

Revoke all roles from a person

Remove all roles in all accounts from a person.

DELETE /people/:id/permissions

Example:

 $ curl -H "Authorization: Bearer <oauth-token>" -X DELETE -H "X-4me-Account: widget" "https://api.4me.com/v1/people/1234/permissions"

Note:

Response

Status: 204 No Content

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_contact
  • auditor
  • financial_manager
  • directory_auditor (for directory accounts only)
  • specialist
  • service_desk_analyst
  • service_desk_manager
  • knowledge_manager
  • problem_manager
  • workflow_manager
  • release_manager
  • project_manager
  • service_level_manager
  • configuration_manager
  • account_designer
  • account_administrator
  • directory_designer (for directory accounts only)
  • directory_administrator (for directory accounts only)
  • workflow_automator_auditor (for 4me Workflow Automator enabled accounts only)
  • workflow_automator_specialist (for 4me Workflow Automator enabled accounts only)
  • account_owner