Info

Created 08-10-2020 by Lavinia Gheghea

Revision



Description

The API allows you to create, delete, and update  employee time sheet. You can retrieve individual employee time sheet as well as a list of all employee time sheets.

Endpoints


GET:  /employeetimesheets?sEmployeeCode=xxxx


Parameters
Headers and Query
 Name
 Description
 Type
 API-key - required
 Authorization Token
 String(64)
 UID - required
 UID -how can be obtained
 String
 DEVICEID - required
  DEVICEID
 String
 sEmployeeCode- required
 Employee Code
 String
 offset
 starting record
 Integer
 limit
 how many records displayed on a page
 Integer
 OrderFieldName
 field name to order the recordset
 String
 OrderDirection
 ASC or DESC
 String
 Filter
 filter the recordset
 String
 dtStartTime
 Start Time
 String
 dtEndTime
 End Time
 String

Curl example

curl -X GET "https://smartapi.smarttid.dk/employeetimesheets?sEmployeeCode=xxxx" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

200 (OK) :  array of employee time sheets

Response body

{ "ID": 156, "EmployeeCode": "9999", "StartTime": "2020-01-07T13:30:00", "EndTime": "2020-01-07T16:30:00", "WorkTypeCode": "NORMALF", "WorkTypeDescription": "Normaltid Funk", "TimeRemark": null, "JobCode": "100", "JobDescription": "SmartTID testjob", "JobOperationLineNumber": 10, "OperationCode": "ARBEJDE", "OperationDescription": "Arbejde", "ActivityCode": "FAKTURERBAR", "ActivityDescription": "Fakturerbart", "JobRemark": null, "ApprovedOnLevel": 2, "DimensionCode1": null, "DimensionCode2": null, "DimensionCode3": null, "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TaskID": 0, "TaskDescription": null, "BreakMin": 0, "BreakDescription": "", "DisplayRemark": null, "DisplayRegistration": "SmartTID testjob / Arbejde / Fakturerbart / Normaltid Funk", "ColorCode": null }, { "ID": 157, "EmployeeCode": "9999", "StartTime": "2020-01-07T17:00:00", "EndTime": "2020-01-07T20:00:00", "WorkTypeCode": "NORMALF", "WorkTypeDescription": "Normaltid Funk", "TimeRemark": null, "JobCode": null, "JobDescription": null, "JobOperationLineNumber": 0, "OperationCode": null, "OperationDescription": null, "ActivityCode": null, "ActivityDescription": null, "JobRemark": null, "ApprovedOnLevel": 2, "DimensionCode1": null, "DimensionCode2": null, "DimensionCode3": null, "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TaskID": 0, "TaskDescription": null, "BreakMin": 0, "BreakDescription": "", "DisplayRemark": null, "DisplayRegistration": "Normaltid Funk", "ColorCode": null }, ]


Response headers:
content-encoding: gzip 
 content-length: 238 
 content-type: application/json; charset=utf-8 
 date: Mon, 24 Aug 2020 08:01:23 GMT 
 server: Microsoft-IIS/10.0 
 vary: Accept-Encoding 
 x-pagination: {"totalCount":4,"totalFiltered":4,"Offset":0,"Limit":4,"Returned":4} 
 x-powered-by: ASP.NET 

400 (ERROR) : Error message

Response Body
Error message


GET{id} : /employeetimesheets/{id}  


Parameters
 Name
 Description
 Type
 API-key - required
 Authorization Token 
 String(64)
 UID - required
UID -how can be obtained
 String
 DEVICEID - required
  DEVICEID
 String
 id- required
 ID of employee time sheet
 Integer
Curl example

curl -X GET "https://smartapi.smarttid.dk/employeetimesheets/id" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

200 (OK) : the employee time sheet

Response Body

{ "ID": 157, "EmployeeCode": "9999", "StartTime": "2020-01-07T17:00:00", "EndTime": "2020-01-07T20:00:00", "WorkTypeCode": "NORMALF", "WorkTypeDescription": "Normaltid Funk", "TimeRemark": null, "JobCode": null, "JobDescription": null, "JobOperationLineNumber": 0, "OperationCode": null, "OperationDescription": null, "ActivityCode": null, "ActivityDescription": null, "JobRemark": null, "ApprovedOnLevel": 2, "DimensionCode1": null, "DimensionCode2": null, "DimensionCode3": null, "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TaskID": 0, "TaskDescription": null, "BreakMin": 0, "BreakDescription": "", "DisplayRemark": null, "DisplayRegistration": "Normaltid Funk", "ColorCode": null  }
]

Response Headers
content-encoding: gzip
  content-length: 175
  content-type: application/json; charset=utf-8 
 date: Mon, 24 Aug 2020 08:39:57 GMT 
 server: Microsoft-IIS/10.0 
 vary: Accept-Encoding  x-powered-by: ASP.NET 

400 (ERROR) : Error message

Response Body
Error message


POST: /employeetimesheets


Parameters
 Name
 Description
 Type
 API-key - required
 Authorization Token 
 String(64)
 UID - required
 UID -how can be obtained
 String
 DEVICEID - required
 DEVICEID
 String
 sEmployeeCode- required
 Employee Code
 String
 sAction
 Action - default value INSERT
 String

Request body
{
  "sEmployeeCode": "string",
  "sStartTime": "string",
  "sEndTime": "string",
  "nStartTime": 0,
  "nEndTime": 0,
  "dtStartTime": "string",
  "dtEndTime": "string",
  "sWorkTypeCode": "string",
  "sTimeRemark": "string",
  "sJobCode": "string",
  "nJobOperationLineNumber": 0,
  "sActivityCode": "string",
  "sJobRemark": "string",
  "nApprovedOnLevel": 0,
  "sApplicationUID": "string",
  "nSyncID": 0,
  "sDimensionCode1": "string",
  "sDimensionCode2": "string",
  "sDimensionCode3": "string",
  "sDimensionCode4": "string",
  "sDimensionCode5": "string",
  "sDimensionCode6": "string",
  "sDimensionCode7": "string",
  "sDimensionCode8": "string",
  "sDimensionCode9": "string",
  "sDimensionCode10": "string",
  "nTaskID": 0
}

Curl example
curl -X POST "https://smartapi.smarttid.dk/employeetimesheets?sEmployeeCode=XXXX" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "Content-Type: application/json-patch+json" -d "{/"sEmployeeCode/": /"string/",  /"sStartTime/": /"string/",  /"sEndTime/": /"string/",  /"nStartTime/": 0,  /"nEndTime/": 0,  /"dtStartTime/": /"string/",  /"dtEndTime/": /"string/",  /"sWorkTypeCode/": /"string/",  /"sTimeRemark/": /"string/", /"sJobCode/": /"string/",  /"nJobOperationLineNumber/": 0,  /"sActivityCode/": /"string/",  /"sJobRemark/": /"string/",  /"nApprovedOnLevel/": 0,  /"sApplicationUID/": /"string/",  /"nSyncID/": 0,  /"sDimensionCode1/": /"string/",  /"sDimensionCode2/": /"string/",  /"sDimensionCode3/": /"string/",  /"sDimensionCode4/": /"string/",  /"sDimensionCode5/": /"string/",  /"sDimensionCode6/": /"string/",  /"sDimensionCode7/": /"string/",  /"sDimensionCode8/": /"string/",  /"sDimensionCode9/": /"string/",  /"sDimensionCode10/": /"string/",  /"nTaskID/": 0}"

Response

200 (OK) : The ID of the new employee time sheet

Response Body
[
 {
  "ID": 25033
 }
]
Response Headers
content-encoding: gzip 
 content-length: 138 
 content-type: application/json; charset=utf-8 
 date: Mon, 24 Aug 2020 09:24:44 GMT 
 server: Microsoft-IIS/10.0 
 vary: Accept-Encoding  x-powered-by: ASP.NET

400 (ERROR) : Error message

Response Body
Error message


PUT{id}: /employeetimesheets/{id}?sEmployeeCode=xxxx


Parameters
 Name
 Description
 Type
 API-key - required
 Authorization Token
 String(64)
 UID - required
UID -how can be obtained
 String
 DEVICEID - required
  DEVICEID
 String
 id- required
 ID of employee time sheet
 Integer

Request body
{
"sEmployeeCode": "string", 
"sStartTime": "string", 
"sEndTime": "string", 
"nStartTime": 0, 
"nEndTime": 0, 
"dtStartTime": "string", 
"dtEndTime": "string", 
"sWorkTypeCode": "string", 
"sTimeRemark": "string", 
"sJobCode": "string", 
"nJobOperationLineNumber": 0, 
"sActivityCode": "string", 
"sJobRemark": "string", 
"nApprovedOnLevel": 0, 
"sApplicationUID": "string", 
"nSyncID": 0, 
"sDimensionCode1": "string", 
"sDimensionCode2": "string", 
"sDimensionCode3": "string", 
"sDimensionCode4": "string", 
"sDimensionCode5": "string", 
"sDimensionCode6": "string", 
"sDimensionCode7": "string", 
"sDimensionCode8": "string", 
"sDimensionCode9": "string", 
"sDimensionCode10": "string", 
"nTaskID": 0
}


Curl example

curl -X PUT "https://smartapi.smarttid.dk/employeetimesheets/id?sEmployeeCode=XXXX" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "Content-Type: application/json-patch+json" -d "{/"sEmployeeCode/": /"string/",  /"sStartTime/": /"string/",  /"sEndTime/": /"string/",  /"nStartTime/": 0,  /"nEndTime/": 0,  /"dtStartTime/": /"string/",  /"dtEndTime/": /"string/",  /"sWorkTypeCode/": /"string/",  /"sTimeRemark/": /"string/", /"sJobCode/": /"string/",  /"nJobOperationLineNumber/": 0,  /"sActivityCode/": /"string/",  /"sJobRemark/": /"string/",  /"nApprovedOnLevel/": 0,  /"sApplicationUID/": /"string/",  /"nSyncID/": 0,  /"sDimensionCode1/": /"string/",  /"sDimensionCode2/": /"string/",  /"sDimensionCode3/": /"string/",  /"sDimensionCode4/": /"string/",  /"sDimensionCode5/": /"string/",  /"sDimensionCode6/": /"string/",  /"sDimensionCode7/": /"string/",  /"sDimensionCode8/": /"string/",  /"sDimensionCode9/": /"string/",  /"sDimensionCode10/": /"string/",  /"nTaskID/": 0}"

Response

200 (OK) : success

400 (ERROR) : Error message

Response Body
Error message


DELETE{id}: /employeetimesheets/{id}


Parameters
 Name
 Description
 Type
 API-key - required
 Authorization Token
 String(64)
 UID - required
 UID -how can be obtained
 String
 DEVICEID - required
  DEVICEID
 String
 id- required
 ID of employee time sheet
 Integer

Curl example

curl -X DELETE "https://smartapi.smarttid.dk/employeetimesheets/id" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 

Response
200 (OK) :Success


400 (ERROR) : Bad request

Response Body
Error message

Response headers

content-length: 84 
 content-type: text/plain; charset=utf-8 
 date: Tue, 25 Aug 2020 08:35:21 GMT 
 server: Microsoft-IIS/10.0 
 x-powered-by: ASP.NET


Object

Employee Time Sheet
 Name
 Description
 Type

sEmployeeCode
 Employee Code
 String
 sStartTime
 Start Time
 String
 sEndTime
 End Time
 String
nStartTime
Start Time
 Integer
 nEndTime
 End Time
 Integer
 dtStartTime
 Start Time
 String
 dtEndTime
End Time
 String
 sWorkTypeCode
 WorkType Code
 String
 sTimeRemark
 Time Remark
 String
 sJobCode
 Job Code
 String
 nJobOperationLineNumber
 Job Operation Line Number
 Double (number)
 sActivityCode
 Activity Code
 String
 sJobRemark
 Job Remark
 String
 nApprovedOnLevel
 Approved on  level
 Integer
 sApplicationUID
 Application UID
 String
 nSyncID
 Sync ID
 Integer
 sDimensionCode1
 Dimension Code 1
 String
 sDimensionCode2
 Dimension Code 2
 String
  sDimensionCode3
 Dimension Code 3
 String
  sDimensionCode4
 Dimension Code 4
 String
  sDimensionCode5
 Dimension Code 5
 String
  sDimensionCode6
 Dimension Code 6
 String
  sDimensionCode7
 Dimension Code 7
 String
  sDimensionCode8
 Dimension Code 8
 String
  sDimensionCode9
 Dimension Code 9
 String
  sDimensionCode10
 Dimension Code 10
 String
 nTaskID
 Task ID
 Integer