๐ŸงฉUser API

To use the User API, it's necessary to generate an access token.

๐Ÿ”—Access Token

A comprehensive toolkit, with practical usage examples, is accessible on GitHub.

This toolkit comes pre-installed as a default component within the on-premises platform, located at /datasentinel/soft/datasentinel_toolkit.

User

Add

POST https://<<platform-server>>/ds-api/users/{email}

Create a User

Path Parameters

NameTypeDescription

email*

String

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Request Body

NameTypeDescription

password

String

User Password Required for Regular users

privilege

String

Possible values: read, read write or admin Default: admin

profile

String

Possible values: developer or data admin Default: data admin

live_360

String

Access to Live360 Feature Possible values: 0 or 1 Default: 1

roles

String array

Since version 2024.04 Roles used for Role Based Access Control

role

String

Deprecated since version 2024.04 use roles instead Role used for Role Based Access Control Default: No restriction

comment

String

ldap

Boolean

Default: false

Response

{
  "status": "User with login <<user>> created successfully"
}

Two Flavors of User Access

  • Regular Users: The Standard Access. You need to specify a password

JSON body example
{
  "password": "myPassword",
  "privilege": "admin",
  "profile": "data admin",
  "live_360": 1,
  "roles": ["role_1", "role_2"],
  "comment": "My comment"
}
  • LDAP Users: For Seamless Network Integration You need to set the ldap value to true.

This POST request assigns privileges to a user authenticated through LDAP.

JSON body example
{
  "ldap": true,
  "privilege": "admin",
  "profile": "data admin",
  "live_360": 1,
  "roles": [],
  "comment": "My comment"
}

Refer to the Documention on setting up LDAP authentication

Display

GET https://<<platform-server>>/ds-api/users/{email}

Display User Attributes

Path Parameters

NameTypeDescription

email*

String

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Response

Example
{
    "id": 54,
    "login": "username",
    "email": "userName@myCompany.com",
    "profile": "data admin",
    "privilege": "admin",
    "roles": ["role_1", "role_2"],
    "live_360": 1,
    "comment": "My comment"
}

Update

PUT https://<<platform-server>>/ds-api/users/{email}

Update User Properties

Path Parameters

NameTypeDescription

email*

String

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Request Body

NameTypeDescription

password

String

User Password

privilege

String

Possible values: read, read write or admin Default: admin

profile

String

Possible values: developer or data admin Default: data admin

live_360

String

Access to Live360 Feature Possible values: 0 or 1 Default: 1

roles

String array

Since version 2024.04 Roles used for Role Based Access Control

role

String

Deprecated since version 2024.04 use roles instead Role used for Role Based Access Control Default: No restriction

comment

String

Response

{
  "status": "User updated successfully!"
}

Delete

DELETE https://<<platform-server>>/ds-api/users/{email}

Delete User

Path Parameters

NameTypeDescription

email*

String

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Response

Example
{
  "message": "User deleted"
}

Assign role

POST https://<<platform-server>>/ds-api/users/{email}/role/{role name}

Add an existing role to a user

Path Parameters

NameTypeDescription

email*

String

role name

String

Existing role

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Response

{
    "status": "Role role_2 has been assigned to myUser@datasentinel.io"
}

Remove role

DELETE https://<<platform-server>>/ds-api/users/{email}/role/{role name}

Remove an existing role from a user

Path Parameters

NameTypeDescription

email*

String

role name

String

Existing role

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Response

{
    "status": "Role role_2 has been removed from myUser@datasentinel.io"
}

Users

Display

GET https://<<platform-server>>/ds-api/users

Display All Users

Headers

NameTypeDescription

user-token*

String

Generated Access Token

Response

Example
 [
    {
        "id": 2,
        "login": "datasentinel",
        "email": "contact@datasentinel.io",
        "profile": "data admin",
        "privilege": "admin",
        "roles": [],
        "live_360": 1,
        "comment": ""
    },
    {
        "id": 54,
        "login": "username",
        "email": "userName@myCompany.com",
        "profile": "data admin",
        "privilege": "read",
        "roles": ["role_1", "role_2"],
        "live_360": 0,
        "comment": ""
    }
]

Last updated