Import Timesheets
Timesheet Import Guide
The timesheet import functionality lets you bring records into the system through various import options. This guide explains the available import methods and the necessary prerequisites for successful imports.
IMPORTANT: Proxy Access Requirements
The Time Import module requires the API Site user to have proxy access to the import record's owner. This setup involves creating a corresponding employee in DATABASICS Admin and granting the necessary proxy access. Follow these steps to configure the required access:
-
Set Up the Employee:
- In the DATABASICS Admin module, create an employee with an ID that matches the API Site user ID. For example, create an employee with the ID
APIUSER
.
- In the DATABASICS Admin module, create an employee with an ID that matches the API Site user ID. For example, create an employee with the ID
-
Grant Proxy Access:
- Grant the newly created employee (
APIUSER
) proxy access to the timesheet(s) of the user(s) whose records will be imported.
- Grant the newly created employee (
-
Create the API Site User:
- Create an API Site user with the same ID (
APIUSER
) in DATABASICS Admin. Ensure the API Site user ID matches the employee ID created in Step 1.
- Create an API Site user with the same ID (
-
Use the API User for Imports:
- You can now use this API Site user to make API calls and successfully import timesheets.
Note: The steps must be followed in the correct order to avoid proxy access errors.
Import Options
-
Import All:
- Imports all records that are new and have never been imported.
-
Import By Batch:
- Requires a batch ID. The batch ID must be entered either during manual entry or in the import template.
- For a single employee with time entries for the same WBS Level 1 and Level 2, this option imports the hours into separate rows.
-
Import By Line:
- Imports only the lines that are explicitly selected from the list.
- For a single employee with time entries for the same WBS Level 1 and Level 2, this option imports the hours into the same row.
-
Import By Line & Batch:
- Imports either the selected lines or the records associated with a batch ID.
- If you choose to import only by line, you must still provide a batch ID. You can use any placeholder value to bypass this required field.
Post-Import Process
Once the records are imported, a pop-up window will display messages about the import status:
- Successful Imports
- Warnings
- Errors
Review the warnings and errors carefully and make any necessary updates. Upon successful import, the entries will be available for viewing on the timesheet.
Call Examples
Get Time Daily Import List
The getTimeDailyImportList
API retrieves a list of imported timesheet records with a specified status.
Request Header
Include the API key in the request header to authenticate the call:
{
"Content-Type": "application/json",
"api-key": "your_api_key"
}
Parameters
To filter the imported records, use the following parameter:
{
"loadStatus": "N" // Load status: "N" for New, "P" for Posted, "W" for Warning, "I" for Information, "E" for Error
}
Example Request
GET https://api.data.basics.net/apihub/apis/getTimeDailyImportList?loadStatus=N
Response
The response will contain a list of timesheet records filtered by the specified load status. Use this information to review or process the records further.
Insert New Timesheet Records
The timeImportNew
API allows you to insert new timesheet records into the system. Use this endpoint to save import new entries with example parameters, such as employee ID, event date, hours, and work breakdown structure (WBS) codes.
Request Header
Include the API key in the request header to authenticate the call:
{
"Content-Type": "application/json",
"api-key": "your_api_key"
}
Parameters
Below is a list of parameters available for the timeImportNew
call, along with their descriptions:
{
"isImport": "N", // Controls action after save. N = Save as New without import, Y = Automatically import.
"emplyId": "JDOE", // Employee ID.
"eventDateH": "2021-09-23", // Event date (required for hours entry type).
"totalHours": 6, // Total hours to be entered.
"payCode": "ST", // Pay Code (max size: 20 characters).
"level1Code": "A", // WBS Level 1 Code (max size: 20 characters).
"level2Code": "B", // WBS Level 2 Code (max size: 20 characters).
"level3Code": "C", // WBS Level 3 Code (max size: 20 characters).
"level4Code": "D", // WBS Level 4 Code (max size: 20 characters).
"optCode": "0002", // Operation Unit Code (max size: 20 characters).
"deptCode": "000000", // Department Code.
"functcode": "000", // Function Code.
"locationCode": "RESTON", // Location Code (max size: 20 characters).
"note": "test", // Note associated with the entry.
"batchId": "222", // Batch ID for grouping entries in a single import call.
"dbHdrStatus": "H", // Timesheet status once imported:
// H = Draft, R = Release, P = Open by Processor, X = Open by Proxy, O = Open by Owner.
"dbTmExist": "R" // Import method for timesheet entry:
// N = New Line, R = Replace, A = Append.
}
Example Request
POST https://api.data-basics.net/apihub/apis/timeImportNew
Request Body:
{
"isImport": "N",
"emplyId": "JDOE",
"eventDateH": "2021-09-23",
"totalHours": 6,
"payCode": "ST",
"level1Code": "A",
"level2Code": "B",
"level3Code": "C",
"level4Code": "D",
"optCode": "0002",
"deptCode": "000000",
"functcode": "000",
"locationCode": "RESTON",
"note": "test",
"batchId": "222",
"dbHdrStatus": "H",
"dbTmExist": "R"
}
Import Timesheet Records into the System
The timeImportAll
API processes timesheet records from the import utility and transfers them into the live system. This call can import all new records or filter records based on specific criteria, such as batch ID.
Request Header
Include the API key in the request header to authenticate the call:
{
"Content-Type": "application/json",
"api-key": "your_api_key"
}
Parameters
Use the following parameters to specify the action to be performed:
{
"actionFlag": "B", // Import Action:
// A = Import all rows with 'N' (New) status.
// B = Import all rows with a matching batchId and 'N' (New) status.
"batchId": "222" // Batch ID: Required if actionFlag = 'B'. Only records with this batchId and loadStatus = N will be processed.
}
Example Request
POST https://api.data-basics.net/apihub/apis/timeImportAll
Request Body:
{
"actionFlag": "B",
"batchId": "222"
}
When to Use Each Action
-
actionFlag: A
(Import All) :
Use this option to import all rows in the import utility that are marked withN
(New) status. -
actionFlag: B
(Import by Batch) :
Use this option to limit the import to records with a specific batch ID. Only rows with the specifiedbatchId
andN
(New) status will be processed.
Response
The response will include details about the success or failure of the import operation, along with messages for any warnings or errors encountered during the process.
Updated about 2 months ago