Info

Created 02-06-2022 by Lavinia Gheghea

Revision



Description

The API allows you to create, delete, and update  work calendar. You can retrieve individual work calendar as well as a list of all workcalendars.

Endpoints


GET:  /workcalendars

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
 sPageName
 Page Name
 String
 nRefID
 Ref ID
 Integer
Curl example

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

Response

200 (OK) :  array of work calendars
Response body
[
  {
    "ID": 173,
    "WorkCalendarCode": "001",
    "Description": "Test log Poul",
    "Active": true,
    "Individual": false,
    "LinkToWorkCalendarCode": null,
    "EmployeeCode": "",
    "ToleranceBeforeStart": "2021-08-13T00:00:00",
    "ToleranceAfterStart": "2021-08-13T00:00:00",
    "ToleranceBeforeEnd": "2021-08-13T00:00:00",
    "ToleranceAfterEnd": "2021-08-13T00:00:00",
    "PayrollPeriodCode": "",
    "WorkTypeCode": "",
    "TotalTime": "07:30",
    "UseDayWhenNotWorkDay": "",
    "NonWorkingdayCode": "",
    "RoundingMethodCodeBreak": "",
    "RoundingMethodCodeStart": "",
    "RoundingMethodCodeEnd": "",
    "DepartmentCode": null,
    "VacationFactor": 1,
    "Name": null,
    "PayrollPeriodDescription": null,
    "WorkTypeDescription": null,
    "NonWorkingDayDescription": null
  },
  {
    "ID": 168,
    "WorkCalendarCode": "1001",
    "Description": "1001 Cristian Paraschiv",
    "Active": false,
    "Individual": true,
    "LinkToWorkCalendarCode": null,
    "EmployeeCode": "1001",
    "ToleranceBeforeStart": "2021-08-04T00:00:00",
    "ToleranceAfterStart": "2021-08-04T00:00:00",
    "ToleranceBeforeEnd": "2021-08-04T00:00:00",
    "ToleranceAfterEnd": "2021-08-04T00:00:00",
    "PayrollPeriodCode": "MDR",
    "WorkTypeCode": "NORMALF",
    "TotalTime": "37:00",
    "UseDayWhenNotWorkDay": "Sun",
    "NonWorkingdayCode": "STANDARD",
    "RoundingMethodCodeBreak": "",
    "RoundingMethodCodeStart": "",
    "RoundingMethodCodeEnd": "",
    "DepartmentCode": null,
    "VacationFactor": 1,
    "Name": "Cristian Paraschiv.",
    "PayrollPeriodDescription": "MÃ¥ned",
    "WorkTypeDescription": "Normaltid Funk",
    "NonWorkingDayDescription": "Standard"
  },
]


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} : /workcalendars/{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 workcalendar
 Integer
Curl example

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

Response

200 (OK) : the work calendar

Response Body
[  { "ID": 173, "WorkCalendarCode": "001", "Description": "Test log Poul", "Active": true, "Individual": false, "LinkToWorkCalendarCode": null, "EmployeeCode": "", "ToleranceBeforeStart": "2021-08-13T00:00:00", "ToleranceAfterStart": "2021-08-13T00:00:00", "ToleranceBeforeEnd": "2021-08-13T00:00:00", "ToleranceAfterEnd": "2021-08-13T00:00:00", "PayrollPeriodCode": "", "WorkTypeCode": "", "TotalTime": "07:30", "UseDayWhenNotWorkDay": "", "NonWorkingdayCode": "", "RoundingMethodCodeBreak": "", "RoundingMethodCodeStart": "", "RoundingMethodCodeEnd": "", "DepartmentCode": null, "VacationFactor": 1, "Name": null, "PayrollPeriodDescription": null, "WorkTypeDescription": null, "NonWorkingDayDescription": 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: /workcalendars


Parameters
 Name
 Description
 Type
 API-key - required
  Authorization Token  
 String(64)
 UID - required
 UID -how can be obtained
 String
 DEVICEID - required
  DEVICEID
 String

Request body
{
  "sWorkCalendarCode": "string",
  "sDescription": "string",
  "bActive": true,
  "bIndividual": true,
  "sLinkToWorkCalendarCode": "string",
  "sEmployeeCode": "string",
  "dtToleranceBeforeStart": "string",
  "dtToleranceAfterStart": "string",
  "dtToleranceBeforeEnd": "string",
  "dtToleranceAfterEnd": "string",
  "sPayrollPeriodCode": "string",
  "sWorkTypeCode": "string",
  "sUseDayWhenNotWorkDay": "string",
  "sNonWorkingdayCode": "string",
  "sRoundingMethodCodeBreak": "string",
  "sRoundingMethodCodeStart": "string",
  "sRoundingMethodCodeEnd": "string",
  "sDepartmentCode": "string",
  "sspBreakStart": "string",
  "sspBreakEnd": "string",
  "sCopyFromWorkCalendarCode": "string",
  "dtMonStartTime": "string",
  "dtMonEndTime": "string",
  "sMonWorkTypeCode": "string",
  "dtTueStartTime": "string",
  "dtTueEndTime": "string",
  "sTueWorkTypeCode": "string",
  "dtWedStartTime": "string",
  "dtWedEndTime": "string",
  "sWedWorkTypeCode": "string",
  "dtThuStartTime": "string",
  "dtThuEndTime": "string",
  "sThuWorkTypeCode": "string",
  "dtFriStartTime": "string",
  "dtFriEndTime": "string",
  "sFriWorkTypeCode": "string",
  "dtSatStartTime": "string",
  "dtSatEndTime": "string",
  "sSatWorkTypeCode": "string",
  "dtSunStartTime": "string",
  "dtSunEndTime": "string",
  "sSunWorkTypeCode": "string"
}

Curl example
curl -X POST "https://smartapi.smarttid.dk/workcalendars" -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 { \"sWorkCalendarCode\": \"string\", \"sDescription\": \"string\", \"bActive\": true, \"bIndividual\": true, \"sLinkToWorkCalendarCode\": \"string\", \"sEmployeeCode\": \"string\", \"dtToleranceBeforeStart\": \"string\", \"dtToleranceAfterStart\": \"string\", \"dtToleranceBeforeEnd\": \"string\", \"dtToleranceAfterEnd\": \"string\", \"sPayrollPeriodCode\": \"string\", \"sWorkTypeCode\": \"string\", \"sUseDayWhenNotWorkDay\": \"string\", \"sNonWorkingdayCode\": \"string\", \"sRoundingMethodCodeBreak\": \"string\", \"sRoundingMethodCodeStart\": \"string\", \"sRoundingMethodCodeEnd\": \"string\", \"sDepartmentCode\": \"stringv", \"sspBreakStart\": \"string\", \"sspBreakEnd\": \"string\", \"sCopyFromWorkCalendarCode\": \"string\", \"dtMonStartTime\": \"string\", \"dtMonEndTime\": \"string\", \"sMonWorkTypeCode\": \"string\", \"dtTueStartTime\": \"string\", \"dtTueEndTime\": \"string\", \"sTueWorkTypeCode\": \"string\", \"dtWedStartTime\": \"string\", \"dtWedEndTime\": \"string\", \"sWedWorkTypeCode\": \"string\", \"dtThuStartTime\": \"string\", \"dtThuEndTime\": \"string\", \"sThuWorkTypeCode\": \"string\", \"dtFriStartTime\": \"string\", \"dtFriEndTime\": \"string\", \"sFriWorkTypeCode\": \"string\",\"dtSatStartTime\": \"string", \"dtSatEndTime\": \"string\", \"sSatWorkTypeCode\": \"string\", \"dtSunStartTime\": \"string\", \"dtSunEndTime\": \"string\", \"sSunWorkTypeCode\": \"string\"}"

Response

200 (OK) : The ID of the new workcalendar

Response Body
[
 {
  "ID": 30
 }
]
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}: /workcalendars/{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 workcalendar
 Integer

Request body



{ 
"sWorkCalendarCode": "string", 
"sDescription": "string", 
"bActive": true, 
"bIndividual": true, 
"sLinkToWorkCalendarCode": "string", 
"sEmployeeCode": "string",
 "dtToleranceBeforeStart": "string", 
"dtToleranceAfterStart": "string", 
"dtToleranceBeforeEnd": "string", 
"dtToleranceAfterEnd": "string", 
"sPayrollPeriodCode": "string", 
"sWorkTypeCode": "string", 
"sUseDayWhenNotWorkDay": "string", 
"sNonWorkingdayCode": "string", 
"sRoundingMethodCodeBreak": "string", 
"sRoundingMethodCodeStart": "string", 
"sRoundingMethodCodeEnd": "string", 
"sDepartmentCode": "string", 
"sspBreakStart": "string",
 "sspBreakEnd": "string", 
"sCopyFromWorkCalendarCode": "string", 
"dtMonStartTime": "string", 
"dtMonEndTime": "string", 
"sMonWorkTypeCode": "string", 
"dtTueStartTime": "string", 
"dtTueEndTime": "string", 
"sTueWorkTypeCode": "string", 
"dtWedStartTime": "string", 
"dtWedEndTime": "string", 
"sWedWorkTypeCode": "string", 
"dtThuStartTime": "string", 
"dtThuEndTime": "string", 
"sThuWorkTypeCode": "string", 
"dtFriStartTime": "string", 
"dtFriEndTime": "string", 
"sFriWorkTypeCode": "string", 
"dtSatStartTime": "string", 
"dtSatEndTime": "string", 
"sSatWorkTypeCode": "string", 
"dtSunStartTime": "string", 
"dtSunEndTime": "string", 
"sSunWorkTypeCode": "string" 
}


Curl example

curl -X PUT "https://smartapi.smarttid.dk/workcalendars/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 { \"sWorkCalendarCode\": \"string\", \"sDescription\": \"string\", \"bActive\": true, \"bIndividual\": true, \"sLinkToWorkCalendarCode\": \"string\", \"sEmployeeCode\": \"string\", \"dtToleranceBeforeStart\": \"string\", \"dtToleranceAfterStart\": \"string\", \"dtToleranceBeforeEnd\": \"string\", \"dtToleranceAfterEnd\": \"string\", \"sPayrollPeriodCode\": \"string\", \"sWorkTypeCode\": \"string\", \"sUseDayWhenNotWorkDay\": \"string\", \"sNonWorkingdayCode\": \"string\", \"sRoundingMethodCodeBreak\": \"string\", \"sRoundingMethodCodeStart\": \"string\", \"sRoundingMethodCodeEnd\": \"string\", \"sDepartmentCode\": \"stringv", \"sspBreakStart\": \"string\", \"sspBreakEnd\": \"string\", \"sCopyFromWorkCalendarCode\": \"string\", \"dtMonStartTime\": \"string\", \"dtMonEndTime\": \"string\", \"sMonWorkTypeCode\": \"string\", \"dtTueStartTime\": \"string\", \"dtTueEndTime\": \"string\", \"sTueWorkTypeCode\": \"string\", \"dtWedStartTime\": \"string\", \"dtWedEndTime\": \"string\", \"sWedWorkTypeCode\": \"string\", \"dtThuStartTime\": \"string\", \"dtThuEndTime\": \"string\", \"sThuWorkTypeCode\": \"string\", \"dtFriStartTime\": \"string\", \"dtFriEndTime\": \"string\", \"sFriWorkTypeCode\": \"string\",\"dtSatStartTime\": \"string", \"dtSatEndTime\": \"string\", \"sSatWorkTypeCode\": \"string\", \"dtSunStartTime\": \"string\", \"dtSunEndTime\": \"string\", \"sSunWorkTypeCode\": \"string\"}"

Response

200 (OK) : success

400 (ERROR) : Error message

Response Body
Error message


DELETE{id}: /workcalendars/{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 workcalendar
 Integer

Curl example

curl -X DELETE "https://smartapi.smarttid.dk/workcalendars/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


SQL Procedure 

sp_WorkCalendar


Object

WorkCalendar
 Name
 Description
 Type
sWorkCalendarCode
 Code of work calendar
 String
sDescription
 Description
 String
 bActive
 Active
bool 
 bIndividual
 Individual
 bool
 sLinkToWorkCalendarCode
 Link to Work Calendar Code
 string
 sEmployeeCode
Employee Code
 string
 dtToleranceBeforeStart
 Tolerance Before Start
string 
 dtToleranceAfterStart
 Tolerance After Start
 string
 dtToleranceBeforeEnd
 Tolerance Before End
 string
 dtToleranceAfterEnd
 Tolerance After End
 string
 sPayrollPeriodCode
 Payroll Period Code
 string
 sWorkTypeCode
 Work Type Code
 string
 sUseDayWhenNotWorkDay
 Use Day When Not Work Day
 string
 sNonWorkingdayCode
 Non Working day Code
 string
 sRoundingMethodCodeBreak
 Rounding Method Code Break
 string
 sRoundingMethodCodeStart
 Rounding Method Code Start
 string
 sRoundingMethodCodeEnd
 Rounding Method Code End
 string
 sDepartmentCode
 Department Code
 string
 sspBreakStart
 spBreakStart
 string
 sspBreakEnd
 spBreakEnd
 string
 sCopyFromWorkCalendarCode
 Copy From Work Calendar Code
 string
 dtMonStartTime
 Mon Start Time
 string
  dtMonEndTime
  Mon End Time
 string
 sMonWorkTypeCode
 Mon Work Type Code
 string
 dtTueStartTime
 Tue Start Time
 string
 dtTueEndTime
 Tue End Time
 string
 sTueWorkTypeCode
 Tue Work Type Code
 string
 dtWedStartTime
 Wed Start Time
 string
 dtWedEndTime
 Wed End Time
 string
sWedWorkTypeCode
Wed Work Type Code
 string
 dtThuStartTime
Thu Start Time
 string
 dtThuEndTime
Thu End Time
 string
sThuWorkTypeCode
 Thu Work Type Code
 string
 dtFriStartTime
 Fri Start Time
 string
 dtFriEndTime
 Fri End Time
 string
 sFriWorkTypeCode
 Fri Work Type Code
 string
 dtSatStartTime
 Sat Start Time
 string
 dtSatEndTime
 Sat End Time
 string
 sSatWorkTypeCode
 Sat Work Type Code
 string
 dtSunStartTime
 Sun Start Time
 string
 dtSunEndTime
 Sun End Time
 string
 sSunWorkTypeCode
 Sun Work Type Code
 string