Info

Created 21-09-2020 by Lavinia Gheghea

Revision

24-05-2022 LG - Added example with Filter on GET endpoint

Description

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

Endpoints


GET:  /employees


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 (Ex: FieldName=value)
 String
 sAction
 Action if is not "Select"
 String

Curl example

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

Curl example with Filter parameter (EmployeeCode='XXXXX')
curl -X GET "https://smartapi.smarttid.dk/employees?Filter=EmployeeCode%3D'XXXXX'" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"


Response

200 (OK) :  array of employees

Response body


[  {      "ID": 187,    "EmployeeCode": "02", "Name": "02", "Address": "", "ZipCode": "", "City": "", "Phone": "", "CellPhone": "", "EMail": "", "CPRNo": null, "DepartmentCode": "TEST", "TeamLeaderCode": "1007", "Active": true, "UseTolerance": true, "TransferToPayroll": true, "WorkFunctionCode": "12345", "TAG": "", "SystemID": "", "PayrollTypeCode": "", "ProfileCode": "FUNK", "JournalCode": "FUNK", "TransferToOutlook": false, "SyncTasksWithExchange": false, "ExchangeUserAndCalendar": null, "DistrictCode": "", "EmployeeGroupCode": "", "LanguageCode": "DK", "Employed": true, "EmployeeCode2": "", "Initials": "", "HoursPerWeek": 0, "SocialWorkerCode": null, "ContactPerson": "", "Caregivers": "", "DimensionCode1": "BMW", "DimensionCode2": "", "DimensionCode3": "", "DimensionCode4": null, "DimensionCode5": null, "TemplateCode": "FUNK", "JobCode": null, "TaskID": 0, "Password": "", "UseSmartPhone": false, "Pin": "", "TAG2": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "WebAdmin": false, "DepartmentName": "ABC", "ProfileCode1": "FUNK", "ProfileDescription": "Funktionærer uden flex", "WorkCalendarCode": "FUNK", "WorkCalendarDescription": "Funktionærer", "JournalDescription": "Funktionærer", "EmployeeGroupName": null, "SalaryEnclosureCode": "", "SalaryEnclosureDescription": null, "HtmlCardTitle": "", "HtmlCardContent": "", "IsTeamLeader": false, "HoursPerDay": 7.4, "AutoAddVacation": true, "VacationSetupCode": "DAGE" }, { "ID": 172, "EmployeeCode": "5264", "Name": "Anita Test", "Address": "Test", "ZipCode": "", "City": "", "Phone": "", "CellPhone": "", "EMail": "amtest@smarttid.dk", "CPRNo": null, "DepartmentCode": "DENMARK", "TeamLeaderCode": "1000", "Active": true, "UseTolerance": true, "TransferToPayroll": true, "WorkFunctionCode": "", "TAG": "", "SystemID": "am", "PayrollTypeCode": "", "ProfileCode": "FUNK", "JournalCode": "FUNK", "TransferToOutlook": false, "SyncTasksWithExchange": false, "ExchangeUserAndCalendar": null, "DistrictCode": "", "EmployeeGroupCode": "", "LanguageCode": "DK", "Employed": true, "EmployeeCode2": "", "Initials": "", "HoursPerWeek": 0, "SocialWorkerCode": null, "ContactPerson": "", "Caregivers": "", "DimensionCode1": "BMW", "DimensionCode2": "39", "DimensionCode3": "BLUE", "DimensionCode4": null, "DimensionCode5": null, "TemplateCode": "FUNK", "JobCode": null, "TaskID": 0, "Password": "1234", "UseSmartPhone": true, "Pin": "", "TAG2": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "WebAdmin": false, "DepartmentName": "Denmark", "ProfileCode1": "FUNK", "ProfileDescription": "Funktionærer uden flex", "WorkCalendarCode": "FUNK", "WorkCalendarDescription": "Funktionærer", "JournalDescription": "Funktionærer", "EmployeeGroupName": null, "SalaryEnclosureCode": "", "SalaryEnclosureDescription": null, "HtmlCardTitle": "", "HtmlCardContent": "", "IsTeamLeader": false, "HoursPerDay": 7.4, "AutoAddVacation": true, "VacationSetupCode": "DAGE" }, ]

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

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

Response

200 (OK) : the employee

Response Body

 { "ID": 187, "EmployeeCode": "02", "Name": "02", "Address": "", "ZipCode": "", "City": "", "Phone": "", "CellPhone": "", "EMail": "", "CPRNo": null, "DepartmentCode": "TEST", "TeamLeaderCode": "1007", "Active": true, "UseTolerance": true, "TransferToPayroll": true, "WorkFunctionCode": "12345", "TAG": "", "SystemID": "", "PayrollTypeCode": "", "ProfileCode": "FUNK", "JournalCode": "FUNK", "TransferToOutlook": false, "SyncTasksWithExchange": false, "ExchangeUserAndCalendar": null, "DistrictCode": "", "EmployeeGroupCode": "", "LanguageCode": "DK", "Employed": true, "EmployeeCode2": "", "Initials": "", "HoursPerWeek": 0, "SocialWorkerCode": null, "ContactPerson": "", "Caregivers": "", "DimensionCode1": "BMW", "DimensionCode2": "", "DimensionCode3": "", "DimensionCode4": null, "DimensionCode5": null, "TemplateCode": "FUNK", "JobCode": null, "TaskID": 0, "Password": "", "UseSmartPhone": false, "Pin": "", "TAG2": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "WebAdmin": false, "DepartmentName": "ABC", "ProfileCode1": "FUNK", "ProfileDescription": "Funktionærer uden flex", "WorkCalendarCode": "FUNK", "WorkCalendarDescription": "Funktionærer", "JournalDescription": "Funktionærer", "EmployeeGroupName": null, "SalaryEnclosureCode": "", "SalaryEnclosureDescription": null, "HtmlCardTitle": "", "HtmlCardContent": "", "IsTeamLeader": false, "HoursPerDay": 7.4, "AutoAddVacation": true, "VacationSetupCode": "DAGE" }
]

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: /employees


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

{ "sEmployeeCode": "string", "sName": "string", "sAddress": "string", "sZipCode": "string", "sCity": "string", "sPhone": "string", "sCellPhone": "string", "sEMail": "string", "sDepartmentCode": "string", "sDistrictCode": "string", "sEmployeeGroupCode": "string", "sTeamLeaderCode": "string", "bActive": true, "bUseTolerance": true, "bTransferToPayroll": true, "sWorkFunctionCode": "string", "sTAG": "string", "sSystemID": "string", "sPayrollTypeCode": "string", "sProfileCode": "string", "sJournalCode": "string", "sTemplateCode": "string", "sLanguageCode": "string", "sEmployeeCode2": "string", "sInitials": "string", "sSocialWorkerCode": "string", "sContactPerson": "string", "sCaregivers": "string", "sDimensionCode1": "string", "sDimensionCode2": "string", "sDimensionCode3": "string", "sDimensionCode4": "string", "sDimensionCode5": "string", "sDimensionCode6": "string", "sDimensionCode7": "string", "sDimensionCode8": "string", "sDimensionCode9": "string", "sDimensionCode10": "string", "sPassword": "string", "bUseSmartPhone": true, "sPin": "string", "dtEmployedStartDate": "string", "bWebAdmin": true, "sSalaryEnclosureCode": "string", "bIsTeamLeader": true, "sRemarks": "string", "nHoursPerDay": 0, "bAutoAddVacation": true, "sVacationSetupCode": "string" }


Curl example
curl -X POST "https://smartapi.smarttid.dk/employees" -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\", \"sName\": \"string\", \"sAddress\": \"string\", \"sZipCode\": \"string\", \"sCity\": \"string\", \"sPhone\": \"string\", \"sCellPhone\": \"string\", \"sEMail\": \"string\", \"sDepartmentCode\": \"string\", \"sDistrictCode\": \"string\", \"sEmployeeGroupCode\": \"string\", \"sTeamLeaderCode\": \"string\", \"bActive\": true, \"bUseTolerance\": true, \"bTransferToPayroll\": true, \"sWorkFunctionCode\": \"string\", \"sTAG\": \"string\", \"sSystemID\": \"string\", \"sPayrollTypeCode\": \"string\", \"sProfileCode\": \"string\", \"sJournalCode\": \"string\", \"sTemplateCode\": \"string\", \"sLanguageCode\": \"string\", \"sEmployeeCode2\": \"string\", \"sInitials\": \"string\", \"sSocialWorkerCode\": \"string\", \"sContactPerson\": \"string\", \"sCaregivers\": \"string\", \"sDimensionCode1\": \"string\", \"sDimensionCode2\": \"string\", \"sDimensionCode3\": \"string\", \"sDimensionCode4\": \"string\", \"sDimensionCode5\": \"string\", \"sDimensionCode6\": \"string\", \"sDimensionCode7\": \"string\", \"sDimensionCode8\": \"string\", \"sDimensionCode9\": \"string\", \"sDimensionCode10\": \"string\", \"sPassword\": \"string\", \"bUseSmartPhone\": true, \"sPin\": \"string\", \"dtEmployedStartDate\": \"string\", \"bWebAdmin\": true, \"sSalaryEnclosureCode\": \"string\", \"bIsTeamLeader\": true, \"sRemarks\": \"string\", \"nHoursPerDay\": 0, \"bAutoAddVacation\": true, \"sVacationSetupCode\": \"string\"}"

Response

200 (OK) : The ID of the new employee

Response Body
[
 {
  "ID": 1234
 }
]
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}: /employees/{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
 Integer

Request body
{
  "sEmployeeCode": "string",
  "sName": "string",
  "sAddress": "string",
  "sZipCode": "string",
  "sCity": "string",
  "sPhone": "string",
  "sCellPhone": "string",
  "sEMail": "string",
  "sDepartmentCode": "string",
  "sDistrictCode": "string",
  "sEmployeeGroupCode": "string",
  "sTeamLeaderCode": "string",
  "bActive": true,
  "bUseTolerance": true,
  "bTransferToPayroll": true,
  "sWorkFunctionCode": "string",
  "sTAG": "string",
  "sSystemID": "string",
  "sPayrollTypeCode": "string",
  "sProfileCode": "string",
  "sJournalCode": "string",
  "sTemplateCode": "string",
  "sLanguageCode": "string",
  "sEmployeeCode2": "string",
  "sInitials": "string",
  "sSocialWorkerCode": "string",
  "sContactPerson": "string",
  "sCaregivers": "string",
  "sDimensionCode1": "string",
  "sDimensionCode2": "string",
  "sDimensionCode3": "string",
  "sDimensionCode4": "string",
  "sDimensionCode5": "string",
  "sDimensionCode6": "string",
  "sDimensionCode7": "string",
  "sDimensionCode8": "string",
  "sDimensionCode9": "string",
  "sDimensionCode10": "string",
  "sPassword": "string",
  "bUseSmartPhone": true,
  "sPin": "string",
  "dtEmployedStartDate": "string",
  "bWebAdmin": true,
  "sSalaryEnclosureCode": "string",
  "bIsTeamLeader": true,
  "sRemarks": "string",
  "nHoursPerDay": 0,
  "bAutoAddVacation": true,
  "sVacationSetupCode": "string"
}

Curl example

curl -X PUT "https://smartapi.smarttid.dk/employees/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 "{\"sEmployeeCode\": \"string\", \"sName\": \"string\", \"sAddress\": \"string\", \"sZipCode\": \"string\", \"sCity\": \"string\", \"sPhone\": \"string\", \"sCellPhone\": \"string\", \"sEMail\": \"string\", \"sDepartmentCode\": \"string\", \"sDistrictCode\": \"string\", \"sEmployeeGroupCode\": \"string\", \"sTeamLeaderCode\": \"string\", \"bActive\": true, \"bUseTolerance\": true, \"bTransferToPayroll\": true, \"sWorkFunctionCode\": \"string\", \"sTAG\": \"string\", \"sSystemID\": \"string\", \"sPayrollTypeCode\": \"string\", \"sProfileCode\": \"string\", \"sJournalCode\": \"string\", \"sTemplateCode\": \"string\", \"sLanguageCode\": \"string\", \"sEmployeeCode2\": \"string\", \"sInitials\": \"string\", \"sSocialWorkerCode\": \"string\", \"sContactPerson\": \"string\", \"sCaregivers\": \"string\", \"sDimensionCode1\": \"string\", \"sDimensionCode2\": \"string\", \"sDimensionCode3\": \"string\", \"sDimensionCode4\": \"string\", \"sDimensionCode5\": \"string\", \"sDimensionCode6\": \"string\", \"sDimensionCode7\": \"string\", \"sDimensionCode8\": \"string\", \"sDimensionCode9\": \"string\", \"sDimensionCode10\": \"string\", \"sPassword\": \"string\", \"bUseSmartPhone\": true, \"sPin\": \"string\", \"dtEmployedStartDate\": \"string\", \"bWebAdmin\": true, \"sSalaryEnclosureCode\": \"string\", \"bIsTeamLeader\": true, \"sRemarks\": \"string\", \"nHoursPerDay\": 0, \"bAutoAddVacation\": true, \"sVacationSetupCode\": \"string\"}"

Response

200 (OK) : success

400 (ERROR) : Error message

Response Body
Error message


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

Curl example

curl -X DELETE "https://smartapi.smarttid.dk/employees/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
 Name
 Description
 Type
 sEmployeeCode
 Employee Code
 String
 sName
 Name
 String
 sAddress
 Address
 String
 sZipCode
 ZipCode
 String
 sCity
 City
 String
 sPhone
 Phone
 String
 sCellPhone
Mobile Phone
 String
 sEMail
 Email address
 String
 sDepartmentCode
 Department Code
 String
 sDistrictCode
 District Code
 String
 sEmployeeGroupCode
 Employee Group Code
 String
 sTeamLeaderCode
 Team Leader Code
 String
 bActive
 Active
 Bool
 bUseTolerance
 Use Tolerance
 Bool
 bTransferToPayroll
Transfer To Payroll
 Bool
 sWorkFunctionCode
 Work Function Code
 String
 sTAG
 TAG
 String
 sSystemID
 SystemID
 String
 sPayrollTypeCode
 Payroll Type Code
 String
 sProfileCode
 Profile Code
 String
 sJournalCode
 Journal Code
 String
 sTemplateCode
 Template Code
 String
 sLanguageCode
 Language Code
 String(2)
 sEmployeeCode2
 Employee Code2
 String
 sInitials
 Initials
 String
 sSocialWorkerCode
 Social Worker Code
 String
 sContactPerson
 Contact Person
 String
 sCaregivers
 Care givers
 String
 sDimensionCode1
 Dimension Code1
 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
 DimensionCode9
 String
 sDimensionCode10
 Dimension Code 10
 String
 sPassword
 Password
 String
 bUseSmartPhone
 Use SmartPhone
 bool
 sPin
 Pin
 String
 dtEmployedStartDate
 Employed Start Date
 String
 bWebAdmin
 Web Admin
 bool
 sSalaryEnclosureCode
 Salary Enclosure Code
 String
 bIsTeamLeader
 is Team Leader
 bool
 sRemarks
 Remarks
 string
 nHoursPerDay
 Hours Per Day
 Double
 bAutoAddVacation
 Auto Add Vacation
 bool
 sVacationSetupCode
 Vacation Setup Code
 String