getActiveProfile
getActiveProfile will retrieve the user profile of the currently authenticated user.
Authentication
A standard OAUTH session must be created before a call can be made to this API. A Bearer token (header) is required.
Endpoint
The user profile is retrieved by submitting a GET request on the following Endpoint.
https://[tenant].lasertask.com/graphql
The [tenant] is the tenant name as used to log in to the Web Application.
Parameters
You may request any one or more of the following parameters…
id
Integer identity number of the currently logged in user.
staff_id
Integer identity number of the Staff table.
String of email address for this user.
created_at
DateTime user was created.
updated_at
DateTime user was last modified.
staff_role_id
Integer of Role this user belong to.
last_logged_in_at
DateTime user last logged in.
SubQuery
The above are common to the getUser and getUsers parameters. The Users table is used for permitting log ins. The Staff table extends the Users table with information related to the Staff of the Tenant.
staff
id
Integer identity of the Staff table.
initials
String initials of the Staff member.
full_name
String with full name of the Staff member.
address
String of the street / first line of the address.
town
String of the Town/City.
county
String of the county/provice.
postcode
String of the postcode/zip code.
telephone
String of the telephone number.
mobile
String of the mobile/cell phone number.
left_company
Integer of the state of the Staff member. 1 = left company.
permissions_id
secure_data_access
Integer defining the level of access this Staff member has to sensitive data.
0 = No Access
1 = Dual Authentication (User and a Supervisor need to authorise access)
2 = Single Authentication (User will need to supply password to reveal information)
3 = Unrestricted (Sensitive data is displayed without requesting password(s))
created_at
DateTime the Staff Member was created.
deleted_at
DateTime the Staff Member was deleted.
updated_at
DateTime the Staff Member was last updated/modified.
Example
getActiveProfile { id: ID! staff_id: Int email: String! created_at: DateTime updated_at: DateTime role: String staff_role_id: Int last_logged_in_companies_id: Int last_logged_in_at: DateTime staff: { id: ID! initials: String! full_name: String! address: String town: String county: String postcode: String telephone: String mobile: String left_company: Int permissions_id: Int secure_data_access: Int created_at: DateTime deleted_at: DateTime updated_at: DateTime } }
Data Returned
All data is returned in a JSON Array.
{ "data": { "getActiveProfile": { "id": "1", "staff_id": 1, "email": "sample@emailaddress.com", "created_at": null, "updated_at": "2020-01-10 11:38:15", "staff_role_id": 3, "last_logged_in_at": "2020-01-10 11:38:15", "staff": { "initials": "JS", "full_name": "John Smith", "address": "10 Oxford Street", "town": "London", "county": "London", "postcode": "SW1 3AB", "telephone": "01234 567890", "mobile": "07009 123456", "left_company": 0, "permissions_id": 3, "secure_data_access": 3, "created_at": "2019-11-19 17:25:24", "deleted_at": null, "updated_at": "2019-11-19 17:25:24" } } } }