Info

Created 24-02-2021 by Lavinia Gheghea

Revision



Description

The API allows you to create task. You can retrieve individual task as well as a list of all tasks.

Endpoints


GET:  /tasks

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
 sJobCode
 Job Code
 String
 nJobOperationLineNumber
 Job Operation Line Number
 Number(double)
 sActivityCode
 Activity Code
 String
Curl example

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

Response

200 (OK) :  array of tasks

Response body

{ "ID": 101, "ShortDescription": "Testopgave - (0.0/9.0)", "LongDescription": null, "JobCode": "100", "JobDescription": "SmartTID testjob", "JobOperationLineNumber": 10, "OperationDescription": "Arbejde", "ActivityCode": "FAKTURERBAR", "ActivityDescription": "Fakturerbart", "ReadyToInvoice": false, "Invoiced": false, "Amount": 0, "ExpectedHours": 0 }, { "ID": 104, "ShortDescription": "Arbejde - (0.0/1.0)", "LongDescription": null, "JobCode": "100", "JobDescription": "SmartTID testjob", "JobOperationLineNumber": 55555, "OperationDescription": "Arbejde", "ActivityCode": null, "ActivityDescription": null, "ReadyToInvoice": false, "Invoiced": false, "Amount": 0, "ExpectedHours": 0 }, { "ID": 106, "ShortDescription": "Welder - (0.0/2.0)", "LongDescription": null, "JobCode": "100", "JobDescription": "SmartTID testjob", "JobOperationLineNumber": 20, "OperationDescription": "Welder", "ActivityCode": null, "ActivityDescription": null, "ReadyToInvoice": false, "Invoiced": false, "Amount": 0, "ExpectedHours": 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} : /tasks/{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 task
 Integer
Curl example

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

Response

200 (OK) : the task

Response Body
[  { "ID": 106, "ShortDescription": "Welder - (0.0/2.0)", "LongDescription": null, "JobCode": "100", "JobDescription": "SmartTID testjob", "JobOperationLineNumber": 20, "OperationDescription": "Welder", "ActivityCode": null, "ActivityDescription": null, "ReadyToInvoice": false, "Invoiced": false, "Amount": 0, "ExpectedHours": 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


POST: /tasks


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
{
"sJobCode": "string",
  "nJobOperationLineNumber": 0,
  "sActivityCode": "string",
  "sShortDescription": "string",
  "sLongDescription": "string",
  "bReadyToInvoice": true,
  "bInvoiced": true,
  "dAmount": 0,
  "nExpectedHours": 0,
  "sStatus": "string"
}

Curl example
curl -X POST "https://smartapi.smarttid.dk/tasks" -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 {\\"sJobCode\": \"string\", \"nJobOperationLineNumber\": 0, \"sActivityCode\": \"string\", \"sShortDescription\": \"string\", \"sLongDescription\": \"string\", \"bReadyToInvoice\": true, \"bInvoiced\": true, \"dAmount\": 0, \"nExpectedHours\": 0, \"sStatus\": \"string\"}"

Response

200 (OK) : The ID of the new task

Response Body
[
 {
  "ID": 3
 }
]
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


Object

Task
 Name
 Description
 Type
sJobCode
 Code of  Job
 String
nJobOperationLineNumber
 Job Operation Line Number
 Number(double)
 sActivityCode
 Activity Code
String
 sShortDescription
 Short Description
 String
 sLongDescription
 Long Description
String
 bReadyToInvoice
 Ready To Invoice
 bool
 bInvoiced
Invoiced
 bool
 dAmount
Amount
Number(double)
 nExpectedHours
Expected Hours
Number(double)
sStatus
 Status
String