API version 1 Timesheets

1. List Timesheets (api1/timesheets)

This method will answer with a collection of iinsight's Timesheets. The collection wil be in JSON format.
The results would be paginated, having a default 100 records per page. An empty collection and a status code 200 response, means that there is no records in the specified page.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api1/timesheets GET
PRODUCTION https://api-ca.iinsightonline.com/api1/timesheets 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
fields Timesheets fields seperated by comma and no blank spaces. (i.e.: field_name1,field_name2,...) (default: all) No
like Filter Timesheets by the value of the field seperated by comma and no blank spaces, "(x)" can be used to match previous or subsequent values, "|" can be used to add multiples values, Operators (<=, >=, <, >, =) can be used to filter values. Format field:value (i.e.: case:25|185,team:(x)47|22(x),description:(x)Seeking(x),quantity:>=2|<5) No
not_like Exclude Timesheets by the value of the field seperated by comma and no blank spaces, "(x)" can be used to avoid previous or subsequent values, "|" can be used to add multiples values, Operators (<=, >=, <, >, <>) can be used to avoid values. Format field:value (i.e.: team:1047|2047, estimate_link:<>0) No
page The page number of the paginated results. (i.e.: 2) (default: 1) No
limit The number of records to display per page. (i.e.: 50) (default: 100) no
Response
{
    "status": true,
    "data": [
        {
            "case_id": "4",
            "id": "48",
            "time_based": "1",
            "description": "Advice on Job Modifications",
            "estimate_link": "0",
            "employee": {
                "user_id": "1",
                "first_name": "iinsight",
                "last_name": "Software Support",
                "name": "iinsight Software Support",
                "title": "Mr"
            },
            "team": {
                "id": "3670",
                "description": "Huascar Team"
            },
            "reference_date": "1289563200",
            "start_time": "12",
            "quantity": "2.00",
            "unit_cost": "0",
            "unit_charge": "140.00",
            "tax_amount": "28.00",
            "tax_rate": "0.10",
            "total_charge": "308.00",
            "charge_code": "RTWNE01",
            "invoice": "315",
            "notes": "",
            "time_inserted": "1290647768",
            "reference_time": "1289526000",
            "payment_status": "N",
            "details": "",
            "appointment_id": {
                "appointment_id": "5125",
                "appointment_name": "Test All fields",
                "appointment_desc": "",
                "appointment_start": "1689908400",
                "appointment_finish": "1689910200"
            },
            "category_id": {
                "category_id": "12",
                "description": "QBE"
            },
            "activity_id": {
                "id": "47",
                "description": "Advice on Job Modifications (Lantern Pay)",
                "time_based": "1",
                "quantity": "0.00",
                "unit_charge": "150.00",
                "taxable": "1",
                "charge_code": "23"
            },
            "consultant_rate": "0.00",
            "consultant_expense_net": "0.00",
            "consultant_expense_tax": "0.00",
            "consultant_expense_total": "0.00",
            "consultant_time_expense": "2.00",
            "consultant_super_rate": "0.000000000000",
            "consultant_super_expense_net": "0.000000",
            "timer_paused": null,
            "live_timer_value": null,
            "signature": null,
            "claim_type": "0"
        }
    ],
    "displayed_records": 1,
    "total_records": 217
}
	

2. Create Timesheet (api1/timesheets)

This method will create a Timesheet and get an answer with the data of the Timesheet created in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api1/timesheets POST
PRODUCTION https://api-ca.iinsightonline.com/api1/timesheets 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
case_id Case Id. (i.e.: 25) Yes
time_based Time Based. (i.e.: Yes) (Values: Yes or No) Yes
quantity Quantity. (i.e.: 1.5) Yes
unit_charge Unit Charge. (i.e.: 195.75) Yes
tax_rate Tax Rate. (i.e.: 0.1) Yes
charge_code Charge Code. (i.e.: OC07) Yes
consultant_rate Consultant Rate. (i.e.: 100) No
consultant_time_expense Consultant Time Expense. (i.e.: 2) No
consultant_expense_tax Consultant Expense Tax. (i.e.: 20) No
consultant_super_rate Consultant Super Rate. (i.e.: 0.2) No
Response
{
    "status": true,
    "message": "Cost successfully created",
    "data": {
        "case_id": "25",
        "id": "8770",
        "time_based": "1",
        "description": "",
        "estimate_link": "0",
        "employee": "0",
        "team": "0",
        "reference_date": "0",
        "start_time": "0",
        "quantity": "1.00",
        "unit_cost": "0",
        "unit_charge": "200.00",
        "tax_amount": "20.00",
        "tax_rate": "0.10",
        "total_charge": "220.00",
        "charge_code": "OS02",
        "invoice": "0",
        "notes": null,
        "time_inserted": "0",
        "reference_time": "0",
        "payment_status": "N",
        "details": "",
        "appointment_id": null,
        "category_id": "0",
        "activity_id": "0",
        "consultant_rate": "100.00",
        "consultant_expense_net": "200.00",
        "consultant_expense_tax": "20.00",
        "consultant_expense_total": "220.00",
        "consultant_time_expense": "2.00",
        "consultant_super_rate": "0.200000000000",
        "consultant_super_expense_net": "40.000000",
        "timer_paused": null,
        "live_timer_value": null,
        "signature": null,
        "claim_type": "0"
    }
}
	

3. Update Timesheet (api1/timesheets)

This method will update a Timesheet and get an answer with the data of the Timesheet updated in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api1/timesheets PUT
PRODUCTION https://api-ca.iinsightonline.com/api1/timesheets PUT
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
id Id. (i.e.: 3015) Yes
case_id Case Id. (i.e.: 25) No
time_based Time Based. (i.e.: No) (Values: Yes or No) No
quantity Quantity. (i.e.: 1.5) No
unit_charge Unit Charge. (i.e.: 195.75) No
tax_rate Tax Rate. (i.e.: 0.1) No
charge_code Charge Code. (i.e.: OC07) No
consultant_rate Consultant Rate. (i.e.: 100) No
consultant_time_expense Consultant Time Expense. (i.e.: 2) No
consultant_expense_tax Consultant Expense Tax. (i.e.: 20) No
consultant_super_rate Consultant Super Rate. (i.e.: 0.2) No
Response
{
    "status": true,
    "message": "Cost successfully updated",
    "data": {
        "case_id": "25",
        "id": "8770",
        "time_based": "1",
        "description": "",
        "estimate_link": "0",
        "employee": "0",
        "team": "0",
        "reference_date": "0",
        "start_time": "0",
        "quantity": "1.00",
        "unit_cost": "0",
        "unit_charge": "200.00",
        "tax_amount": 20,
        "tax_rate": "0.10",
        "total_charge": 220.00000000000003,
        "charge_code": "OS02",
        "invoice": "0",
        "notes": null,
        "time_inserted": "0",
        "reference_time": "0",
        "payment_status": "N",
        "details": "",
        "appointment_id": null,
        "category_id": "0",
        "activity_id": "0",
        "consultant_rate": "100.00",
        "consultant_expense_net": 100,
        "consultant_expense_tax": "10",
        "consultant_expense_total": 110,
        "consultant_time_expense": "1",
        "consultant_super_rate": "0.200000000000",
        "consultant_super_expense_net": 20,
        "timer_paused": null,
        "live_timer_value": null,
        "signature": null,
        "claim_type": "0"
    }
}
	

4. Delete Timesheet (api1/timesheets)

This method will delete a Timesheet and get an answer confirming the deletion of the record in iinsight. The collection wil be in JSON format.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api1/timesheets DELETE
PRODUCTION https://api-ca.iinsightonline.com/api1/timesheets DELETE
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
id Id. (i.e.: 3015) Yes
Response
{
    "status": true,
    "message": "Cost successfully deleted"
}
	

5. Get Timesheet Totals (api1/timesheets_totals)

This method will answer with timesheet totals data. The collection wil be in JSON format.
The results would be paginated, having a default 100 records per page. An empty collection and a status code 200 response, means that there is no records in the specified page.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api1/timesheets_totals GET
PRODUCTION https://api-ca.iinsightonline.com/api1/timesheets_totals 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_ids Comma separated list of user IDs. e.g. 1,2,3 No
cost_status Cost status filter. (1.- Invoiced, 2.- Uninvoiced, 3.- On Hold). Empty means all. No
cost_type Cost type filter. (0.- Item, 1.- Activity). Empty means all. No
internal_expenses Internal expenses filter. (1.- Excluding, 1.- Including). Empty means excluding. No
date_from Date from filter in d/m/Y format. e.g. 25/12/2024 No
date_to Date to filter in d/m/Y format. e.g. 25/12/2024 No
Response
{
    "activities_duration": "621:07",
    "activities_amount": 20579.73,
    "items_quantity": 747.3,
    "items_amount": 9168.36,
    "amount": 29748.09,
    "employee_activities_duration": "621:01",
    "employee_activities_amount": 6,
    "employee_items_quantity": 788.66,
    "employee_items_amount": 44.4,
    "employee_amount": 50.4
}