15. Users

Interface

It allows you:

  • to get list of users

  • create new user (only by Admin, with a predefined Role) / an user without Role can not acces the system!

  • to update an existing user data and change password (each user can update only their data)

  • to set a standard picture (get & delete also)

Columns that can be used as filters:

  • Organization

  • Name (including ”like”)

  • Email

  • Active

  • HasRole - ("true"/"false") if indicated, will return only that users with at least one role assigned

  • RoleName - use the name of role as it is listed by API Roles

  • HasApprovalRole:

    • true - will return users within role with approval limit > 0, means ”approvers”

    • false - will return users within role with approval limit = 0 or null, means ”non-approvers”

Actions can be done:

  • list

  • create

  • update

  • delete

  • add_role

  • add_organization

{

"data": [

{

"Organization": "*",

"Created": "2014-01-06 10:29:32+0200",

"CreatedBy": "SuperUser",

"Updated": "2014-08-11 08:05:32+0300",

"UpdatedBy": "SuperUser",

"User_ID": 10923890

"Name": "Some User",

"FirstName": null,

"LastName": null,

"Email": "some.user@domain.com",

"Active": true,

"Password": "***",

"Title": "Reprezentant Comercial",

"Job": "Sef",

"WebShopToken": null,

"activities":[

{

"Activity_ID": 1000122,

"Name": Dulgherie

}

]

}

],

"totalRows": 1

}

API Methods:

List:

URL: https://api.socratecloud.com/webapi/rest/user/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}

Method: GET

Return: JSON object with next format:

Create:

URL: https://api.socratecloud.com/webapi/rest/user/create/{version}?accessToken={access_token}

Method: POST

Return: user email for success or error message (start with "ERROR: ")

Data format:

{

"Organization": "*",

"Name": "Some new user",

"FirstName": null,

"LastName": null,

"Email": "some.new.user@domain.com",

"Password": "123",

"WebShopToken": null

}

Update:

URL: https://api.socratecloud.com/webapi/rest/user/update/{version}?accessToken={access_token}&Email={user_email}

Method: POST

Return: user email for success or error message (start with "ERROR: ")

Data format:

{

"Organization": "*",

"Name": "User name updated",

"FirstName": null,

"LastName": null,

"Email": "some.new.user@domain.com",

"Active": false,

"Password": "1234",

"WebShopToken": null

}

Delete:

URL: https://api.socratecloud.com/webapi/rest/user/delete/{version}?accessToken={access_token}&Email={user_email}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")

Add_Role:

Add a role to user specified by email in parameters lists. For roles list, see API Roles

URL: https://api.socratecloud.com/webapi/rest/user/add_role/{version}?accessToken={access_token}&Email={user_email}&Role={user_role}

Method: POST

Return: 'OK' for success or error message (start with "ERROR: ")

Add_Organization:

Add Organization access to user specified by email in parameters lists. For Organization list, see API Organizations

URL: https://api.socratecloud.com/webapi/rest/user/add_organization/{version}?accessToken={access_token}&Email={user_email}&Organization={user_organization}

Method: POST

Return: 'OK' for success or error message (start with "ERROR: ")

Get picture:

URL: https://api.socratecloud.eu/webapi/rest/user/picture/{version}?accessToken={access_token}&Email={user_email}

Method: GET

Return: PNG file or 204/"No Content" if no picture found

Set picture:

URL: https://api.socratecloud.com/webapi/rest/user/picture/set/{version}?accessToken={access_token}&Email={user_email}

Method: POST

Return 'Ok' for success or error message (start with "ERROR: ")

Note: Only PNG file are accepted

Delete picture:

URL: https://api.socratecloud.com/webapi/rest/user/picture/delete/{version}?accessToken={access_token}&Email={user_email}

Method: POST

Return 'Ok' for success or error message (start with "ERROR: ")

Change Password:

URL: https://api.socratecloud.com/webapi/rest/user/change_password/{version}?accessToken={access_token}

Method: POST

Return 'Ok' for success or error message (start with "ERROR: ")

Data format:

{

"OldPassword": "1234",

"NewPassword": "abcd"

}