Info

Created 11-03-2021 by Lavinia Gheghea

Revision



Description

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

Endpoints


GET:  /templates


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

Curl example

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

Response

200 (OK) :  array of templates

Response body

{ "ID": 11, "TemplateCode": "12345", "Description": "teste", "DistrictCode": "", "DepartmentCode": "", "EmployeeGroupCode": "", "JournalCode": "", "PayrollTypeCode": "", "WorkFunctionCode": "", "ProfileCode": "", "SocialWorkerCode": "", "WorkCalendarCode": "", "Active": false, "DimensionCode1": "", "DimensionCode2": "", "DimensionCode3": "", "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TeamLeaderCode": "CBZQ", "VacationSetupCode": "TIME" }, { "ID": 10, "TemplateCode": "cbtest", "Description": "", "DistrictCode": "JYL", "DepartmentCode": "DENMARK", "EmployeeGroupCode": "", "JournalCode": "FUNK", "PayrollTypeCode": "", "WorkFunctionCode": "12345", "ProfileCode": "12", "SocialWorkerCode": "", "WorkCalendarCode": "1234", "Active": true, "DimensionCode1": "", "DimensionCode2": "", "DimensionCode3": "", "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TeamLeaderCode": "1000", "VacationSetupCode": "DAGE" }, { "ID": 3, "TemplateCode": "FUNK", "Description": "Funktionærer uden flex", "DistrictCode": "", "DepartmentCode": "", "EmployeeGroupCode": null, "JournalCode": "FUNK", "PayrollTypeCode": "", "WorkFunctionCode": "", "ProfileCode": "FUNK", "SocialWorkerCode": "", "WorkCalendarCode": "FUNK", "Active": true, "DimensionCode1": "BMW", "DimensionCode2": "37", "DimensionCode3": null, "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TeamLeaderCode": null, "VacationSetupCode": 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} : /templates/{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 template
 Integer
Curl example

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

Response

200 (OK) : the template

Response Body

 { "ID": 3, "TemplateCode": "FUNK", "Description": "Funktionærer uden flex", "DistrictCode": "", "DepartmentCode": "", "EmployeeGroupCode": null, "JournalCode": "FUNK", "PayrollTypeCode": "", "WorkFunctionCode": "", "ProfileCode": "FUNK", "SocialWorkerCode": "", "WorkCalendarCode": "FUNK", "Active": true, "DimensionCode1": "BMW", "DimensionCode2": "37", "DimensionCode3": null, "DimensionCode4": null, "DimensionCode5": null, "DimensionCode6": null, "DimensionCode7": null, "DimensionCode8": null, "DimensionCode9": null, "DimensionCode10": null, "TeamLeaderCode": null, "VacationSetupCode": 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: /templates


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
{
"sTemplateCode": "string",
  "sDescription": "string",
  "sDistrictCode": "string",
  "sDepartmentCode": "string",
  "sEmployeeGroupCode": "string",
  "sJournalCode": "string",
  "sPayrollTypeCode": "string",
  "sWorkFunctionCode": "string",
  "sProfileCode": "string",
  "sSocialWorkerCode": "string",
  "sWorkCalendarCode": "string",
  "bActive": true,
  "sDimensionCode1": "string",
  "sDimensionCode2": "string",
  "sDimensionCode3": "string",
  "sDimensionCode4": "string",
  "sDimensionCode5": "string",
  "sDimensionCode6": "string",
  "sDimensionCode7": "string",
  "sDimensionCode8": "string",
  "sDimensionCode9": "string",
  "sDimensionCode10": "string",
  "sTeamLeaderCode": "string",
  "sVacationSetupCode": "string"
}
Curl example
curl -X POST "https://smartapi.smarttid.dk/templates" -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 "{\"sTemplateCode\": \"string\",  \"sDescription\": \"string\",  \"sDistrictCode\": \"string\",  \"sDepartmentCode\": \"string\",  \"sEmployeeGroupCode\": \"string\",  \"sJournalCode\": \"string\",  \"sPayrollTypeCode\": \"string\",  \"sWorkFunctionCode\": \"string\",  \"sProfileCode\": \"string\",  \"sSocialWorkerCode\": \"string\",  \"sWorkCalendarCode\": \"string\",  \"bActive\": true,  \"sDimensionCode1\": \"string\",  \"sDimensionCode2\": \"string\",  \"sDimensionCode3\": \"string\",  \"sDimensionCode4\": \"string\",  \"sDimensionCode5\": \"string\",  \"sDimensionCode6\": \"string\",  \"sDimensionCode7\": \"string\",  \"sDimensionCode8\": \"string\",  \"sDimensionCode9\": \"string\",  \"sDimensionCode10\": \"string\",  \"sTeamLeaderCode\": \"string\",  \"sVacationSetupCode\": \"string\"}"

Response

200 (OK) : The ID of the new template

Response Body
[
 {
  "ID": 14
  }
]
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}: /templates/{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 template
 Integer

Request body
{
"sTemplateCode": "string",
  "sDescription": "string",
  "sDistrictCode": "string",
  "sDepartmentCode": "string",
  "sEmployeeGroupCode": "string",
  "sJournalCode": "string",
  "sPayrollTypeCode": "string",
  "sWorkFunctionCode": "string",
  "sProfileCode": "string",
  "sSocialWorkerCode": "string",
  "sWorkCalendarCode": "string",
  "bActive": true,
  "sDimensionCode1": "string",
  "sDimensionCode2": "string",
  "sDimensionCode3": "string",
  "sDimensionCode4": "string",
  "sDimensionCode5": "string",
  "sDimensionCode6": "string",
  "sDimensionCode7": "string",
  "sDimensionCode8": "string",
  "sDimensionCode9": "string",
  "sDimensionCode10": "string",
  "sTeamLeaderCode": "string",
  "sVacationSetupCode": "string"
}
Curl example

curl -X PUT "https://smartapi.smarttid.dk/templates/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 "{\"sTemplateCode\": \"string\",  \"sDescription\": \"string\",  \"sDistrictCode\": \"string\",  \"sDepartmentCode\": \"string\",  \"sEmployeeGroupCode\": \"string\",  \"sJournalCode\": \"string\",  \"sPayrollTypeCode\": \"string\",  \"sWorkFunctionCode\": \"string\",  \"sProfileCode\": \"string\",  \"sSocialWorkerCode\": \"string\",  \"sWorkCalendarCode\": \"string\",  \"bActive\": true,  \"sDimensionCode1\": \"string\",  \"sDimensionCode2\": \"string\",  \"sDimensionCode3\": \"string\",  \"sDimensionCode4\": \"string\",  \"sDimensionCode5\": \"string\",  \"sDimensionCode6\": \"string\",  \"sDimensionCode7\": \"string\",  \"sDimensionCode8\": \"string\",  \"sDimensionCode9\": \"string\",  \"sDimensionCode10\": \"string\",  \"sTeamLeaderCode\": \"string\",  \"sVacationSetupCode\": \"string\"}"

Response

200 (OK) : success

400 (ERROR) : Error message

Response Body
Error message


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

Curl example

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

Template
 Name
 Description
 Type
sTemplateCode
 Code of template
 String
sDescription
 Description
 String
 sDistrictCode
 District Code
 String
 sDepartmentCode
 Department Code
String
 sEmployeeGroupCode
 Employee Group Code
 String
 sJournalCode
 Journal Code
 String
 sPayrollTypeCode
 Payroll Type Code
 String
 sWorkFunctionCode
 WorkFunction Code
 String
 sProfileCode
 Profile Code
 String
 sSocialWorkerCode
 Social Worker Code
 String
 sWorkCalendarCode
 Work Calendar Code
 String
 bActive
 Active
 bool
 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 
 sTeamLeaderCode
 Team Leader Code
 String
 sVacationSetupCode
 Vacation Setup Code
 String