1. Save Location (api1/users/save_location)

This method will allow to create a new location.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/save_location POST
PRODUCTION https://api-aus.iinsightonline.com/api1/users/save_location POST
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
latitude Latitude is a units that represent the coordinates at geographic coordinate system. (i.e.: -33.830840) Yes
longitude Longitude is a units that represent the coordinates at geographic coordinate system. (i.e.: 151.064797) Yes
Response
{
    "response": "Location created",
    "location_id": 6
}

2. Save device (api1/users/save_device)

This method allows to save a device token for a user, in order to send PUSH notifications.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/save_device GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/save_device GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
device_token A device token Yes
Response
{
    "response": "Device created",
    "device_id": 6
}

3. List user's Consultant Availability (api1/users/list_worktime)

This method will answer with a collection of a specific user workable frame (located on Admin->Manage Users->Consultant Availability). The collection wil be in JSON format.

If the User is not a consultant, the workable frame will be always from 0 to 0.

The time value will be a number between 0 and 1440. The values are the number of minutes elapsed from 00:00 am.

time_from1 and time_to1 are the initial and final time for Mondays. time_from7 and time_to7 are the initial and final time for Sundays.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/list_worktime GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/list_worktime GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
Response
[{
        "email": "xxx@bizexpress.com.au",
        "appt_time_from1": "0", // Monday 00:00 am
        "appt_time_to1": "1440", // Monday 00:00 pm 
        "appt_time_from2": "540", // Tuesday 09:00 am 
        "appt_time_to2": "1020", // Tuesday 05:00 9m 
        "appt_time_from3": "0", 
        "appt_time_to3": "0",
        "appt_time_from4": "0",
        "appt_time_to4": "0",
        "appt_time_from5": "0",
        "appt_time_to5": "0",
        "appt_time_from6": "0",
        "appt_time_to6": "0",
        "appt_time_from7": "0", // Sunday 00:00 am
        "appt_time_to7": "0", // Sunday 00:00 pm
        "mfa_successfully_enrolled" : "1" //1=true and 0=false
}]

4. Validate MFA (api1/users/validate_mfa)

This method will return true if the MFA is validated correctly and false if not.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/validate_mfa GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/validate_mfa GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
mfa_code The code generated using Google Authenticator. Users needs to enroll on iinsight's Web before using the API. Yes
Response
{
    "valid_mfa": "false",
    "response": "MFA is not valid"
}

5. Save device Status (api1/users/save_device_status)

This method allows to save the status of a device for a specific user, the status we are saving is the geoposition function of each phone.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/save_device_status GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/save_device_status GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
enable_geoposition 1=allow saving geopositioning / 0=don´t allow geopositioing Yes
Response
{
    "response": "Device Status created",
    "device_status_id": 1
}

6. List User Teams (api1/users/teams)

This method will answer with a collection of User's Teams. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/teams GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/teams GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
user_id An iinsight user ID. Yes
Response

      [
        {
          "id": "4228",
          "name": "Adminstration"
        },
        {
          "id": "4498",
          "name": "Safety Team"
        }
      ]
    

7. List Users (api1/users)

This method will answer with a collection of iinsight Users. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
team_id Team ID. (i.e.: 1) No
fields Contacs fields seperated by comma and no blank spaces. (i.e.: field_name1,field_name2,...) Yes
sort_col Sort by column field name. (i.e.: field_name) No
sort_type Sort column type. Options: asc, desc No
search_criteria Search field name. (i.e.: {"field_name1":"value1","field_name2":"value1,value2"}) No
page The page number of the paginated results. (i.e.: 1) No
limit The limit amount of items. (i.e.: 1) No
Response

    [
      {
        "name": "test user",
        "first_name": "test",
        "last_name": "user",
        "email": "user@test.com.au",
        "user_id": "4"
      },
      {
        "name": "test user",
        "first_name": "test",
        "last_name": "user",
        "email": "user@test.com.au",
        "user_id": "5"
      },
    ]

8. List user's roles (api1/users/roles)

This method will answer with a collection of user's roles. The collection will be in JSON format.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/roles GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/roles GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
case_id Case ID. (i.e.: 1) Yes
employee_id Employee ID. (i.e.: 1) (if no employee ID is give, it will use to current employee ID) No
Response

    [
      {
          "id": 9,
          "name": "xxx"
      },
      {
          "id": 10,
          "name": "xxx"
      }
    ]

9. Get current user details (api1/users/current_user_details)

This method will answer with the current user details.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api1/users/current_user_details GET
PRODUCTION https://api-aus.iinsightonline.com/api1/users/current_user_details GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Response

    {
      "name": "John Doe",
      "image": "url_to_image",
      "login_time_last": "April 4, 2024, 11:39 pm",
      "time_zone": "Europe/London",
      "date_format": "d-m-y",
      "type": "standard/support"
    }