Info

Created 12-03-2021 by Lavinia Gheghea

Revision



Description

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

Endpoints


GET:  /timesheets

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
 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
 sAction
 Action
 String
 dtStartDate
 Start Date
 String

Curl example

curl -X GET "https://smartapi.smarttid.dk/timesheets?dtStartDate=yyyy-mm-dd" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

200 (OK) :  array of  time sheets

Response body
[
 {
    "ID": 65,
    "StartDate": "2019-12-09T00:00:00",
    "MonStartTime": null,
    "TueStartTime": null,
    "WedStartTime": null,
    "ThuStartTime": null,
    "FriStartTime": null,
    "SatStartTime": null,
    "SunStartTime": null,
    "ApprovedOnLevel": 0
  }
]

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} : /timesheets/{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 time sheet
 Integer
Curl example

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

Response

200 (OK) : the time sheet

Response Body
[
 {
    "ID": 65,
    "StartDate": "2019-12-09T00:00:00",
    "MonStartTime": null,
    "TueStartTime": null,
    "WedStartTime": null,
    "ThuStartTime": null,
    "FriStartTime": null,
    "SatStartTime": null,
    "SunStartTime": null,
    "ApprovedOnLevel": 0
  }
]


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



PUT{id}: /timesheets/{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 time sheet
 Integer

Request body


{
  "dtMonStartTime": "string",
  "dtTueStartTime": "string",
  "dtWedStartTime": "string",
  "dtThuStartTime": "string",
  "dtFriStartTime": "string",
  "dtSatStartTime": "string",
  "dtSunStartTime": "string",
  "nApprovedOnLevel": 0
}


Curl example

curl -X PUT "https://smartapi.smarttid.dk/timesheets/id" -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 {\"dtMonStartTime\": \"string\",  \"dtTueStartTime\": \"string\",  \"dtWedStartTime\": \"string\",  \"dtThuStartTime\": \"string\",  \"dtFriStartTime\": \"string\",  \"dtSatStartTime\": \"string\",  \"dtSunStartTime\": \"string\",  \"nApprovedOnLevel\": 0}"

Response

200 (OK) : success

400 (ERROR) : Error message

Response Body
Error message


Object

Time Sheet
 Name
 Description
 Type
dtMonStartTime
Monday Start Time
String
dtTueStartTime
Tuesday Start Time
 String
dtWedStartTime
Wednesday Start Time
String
 dtThuStartTime
 Thursday Start Time
 String
 dtFriStartTime
 Friday Start Time
 String
 dtSatStartTime
 Saturday Start Time
 String
 dtSunStartTime
Sunday Start Time
 String
 nApproveOnLevel
 Approve On Level
 Number (integer)