Info
Created 26-01-2021 by Lavinia
Gheghea
Revision
Description
The API
allows you to create, delete,
and update operation.
You can retrieve individual operation as well as a list
of all operations.
Endpoints
GET: /operations
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/operations" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
200 (OK) : array of operations
Response body
[{ "ID": 90, "OperationCode": "10", "Description": "Welder", "ExtraPay": false, "ReportScrap": true, "ReportProduced": true, "Concurrent": false, "PricePerHour": null, "WorkTypeCode": null, "Type": null, "ConccurrentWith": null, "MandatorySetup": false, "OverNight": null, "CheckForCerificate": null, "OperationGroupCode": "", "Color": "White", "StoredProcedureWhenStart": null, "StoredProcedureWhenStop": null, "StoredProcedureWhenCompleted": null, "OperationType": null, "ReturnPlannedTimeAsTotal": false, "CheckForCharge": false, "MachineTime": false, "PieceWorkTime": false, "FormBeforeStart": null, "FormAfterStop": null, "ColorCode": "ORANGE", "ReportMaterial": false, "PromptForStartStopTime": false, "AskForRemarkWhen": "Stop" }, { "ID": 87, "OperationCode": "ARBEJDE", "Description": "Arbejde", "ExtraPay": false, "ReportScrap": true, "ReportProduced": true, "Concurrent": false, "PricePerHour": null, "WorkTypeCode": null, "Type": null, "ConccurrentWith": null, "MandatorySetup": false, "OverNight": null, "CheckForCerificate": null, "OperationGroupCode": "", "Color": "White", "StoredProcedureWhenStart": null, "StoredProcedureWhenStop": null, "StoredProcedureWhenCompleted": null, "OperationType": null, "ReturnPlannedTimeAsTotal": false, "CheckForCharge": false, "MachineTime": false, "PieceWorkTime": false, "FormBeforeStart": null, "FormAfterStop": null, "ColorCode": "BLĂ…", "ReportMaterial": false, "PromptForStartStopTime": false, "AskForRemarkWhen": null }, { "ID": 88, "OperationCode": "TEST", "Description": "test111", "ExtraPay": false, "ReportScrap": true, "ReportProduced": true, "Concurrent": false, "PricePerHour": null, "WorkTypeCode": null, "Type": null, "ConccurrentWith": null, "MandatorySetup": false, "OverNight": null, "CheckForCerificate": null, "OperationGroupCode": "", "Color": "White", "StoredProcedureWhenStart": null, "StoredProcedureWhenStop": null, "StoredProcedureWhenCompleted": null, "OperationType": null, "ReturnPlannedTimeAsTotal": false, "CheckForCharge": false, "MachineTime": false, "PieceWorkTime": false, "FormBeforeStart": null, "FormAfterStop": null, "ColorCode": "", "ReportMaterial": false, "PromptForStartStopTime": false, "AskForRemarkWhen": "Both" }, ]
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} : /operations/{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 operation | Integer |
Curl example
curl -X GET "https://smartapi.smarttid.dk/operations/id" -H "accept: */*" -H "UID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "DEVICEID:demo@smarttid.dk" -H "API-Key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
200 (OK) : the operation
Response Body
[{ "ID": 88, "OperationCode": "TEST", "Description": "test111", "ExtraPay": false, "ReportScrap": true, "ReportProduced": true, "Concurrent": false, "PricePerHour": null, "WorkTypeCode": null, "Type": null, "ConccurrentWith": null, "MandatorySetup": false, "OverNight": null, "CheckForCerificate": null, "OperationGroupCode": "", "Color": "White", "StoredProcedureWhenStart": null, "StoredProcedureWhenStop": null, "StoredProcedureWhenCompleted": null, "OperationType": null, "ReturnPlannedTimeAsTotal": false, "CheckForCharge": false, "MachineTime": false, "PieceWorkTime": false, "FormBeforeStart": null, "FormAfterStop": null, "ColorCode": "", "ReportMaterial": false, "PromptForStartStopTime": false, "AskForRemarkWhen": "Both" }]
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: /operations
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
{ "sOperationCode": "string", "sDescription": "string", "bExtraPay": true, "bReportScrap": true, "bReportProduced": true, "bConcurrent": true, "nPricePerHour": 0, "sWorkTypeCode": "string", "sType": "string", "sConccurentWith": "string", "bMandatorySetup": true, "bOverNight": true, "bCheckForCertificate": true, "sOperationGroupCode": "string", "sColor": "string", "sStoredProcedureWhenStart": "string", "sStoredProcedureWhenStop": "string", "sStoredProcedureWhenCompleted": "string", "sOperationType": "string", "bReturnPlannedTimeAsTotal": true, "bCheckForCharge": true, "bMachineTime": true, "bPieceWorkTime": true, "nFormBeforeStart": 0, "nFormAfterStop": 0, "sColorCode": "string", "bReportMaterial": true, "bPromptForStartStopTime": true, "sAskForRemarkWhen": "string" }
Curl example
curl -X POST "https://smartapi.smarttid.dk/operations" -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 {\"sOperationCode\": \"string\", \"sDescription\": \"string\", \"bExtraPay\": true, \"bReportScrap\": true, \"bReportProduced\": true, \"bConcurrent\": true, \"nPricePerHour\": 0, \"sWorkTypeCode\": \"string\", \"sType\": \"string\", \"sConccurentWith\": \"string\", \"bMandatorySetup\": true, \"bOverNight\": true, \"bCheckForCertificate\": true, \"sOperationGroupCode\": \"string\", \"sColor\": \"string\", \"sStoredProcedureWhenStart\": \"string\", \"sStoredProcedureWhenStop\": \"string\", \"sStoredProcedureWhenCompleted\": \"string\", \"sOperationType\": \"string\", \"bReturnPlannedTimeAsTotal\": true, \"bCheckForCharge\": true, \"bMachineTime\": true, \"bPieceWorkTime\": true, \"nFormBeforeStart\": 0, \"nFormAfterStop\": 0, \"sColorCode\": \"string\", \"bReportMaterial\": true, \"bPromptForStartStopTime\": true, \"sAskForRemarkWhen\": \"string\"}"
Response
200 (OK) : The ID of the new operation
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
PUT{id}: /operations/{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 operation | Integer |
Request body
{ "sOperationCode": "string", "sDescription": "string", "bExtraPay": true, "bReportScrap": true, "bReportProduced": true, "bConcurrent": true, "nPricePerHour": 0, "sWorkTypeCode": "string", "sType": "string", "sConccurentWith": "string", "bMandatorySetup": true, "bOverNight": true, "bCheckForCertificate": true, "sOperationGroupCode": "string", "sColor": "string", "sStoredProcedureWhenStart": "string", "sStoredProcedureWhenStop": "string", "sStoredProcedureWhenCompleted": "string", "sOperationType": "string", "bReturnPlannedTimeAsTotal": true, "bCheckForCharge": true, "bMachineTime": true, "bPieceWorkTime": true, "nFormBeforeStart": 0, "nFormAfterStop": 0, "sColorCode": "string", "bReportMaterial": true, "bPromptForStartStopTime": true, "sAskForRemarkWhen": "string" }
Curl example
curl -X PUT "https://smartapi.smarttid.dk/operations/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 {\"sOperationCode\": \"string\", \"sDescription\": \"string\", \"bExtraPay\": true, \"bReportScrap\": true, \"bReportProduced\": true, \"bConcurrent\": true, \"nPricePerHour\": 0, \"sWorkTypeCode\": \"string\", \"sType\": \"string\", \"sConccurentWith\": \"string\", \"bMandatorySetup\": true, \"bOverNight\": true, \"bCheckForCertificate\": true, \"sOperationGroupCode\": \"string\", \"sColor\": \"string\", \"sStoredProcedureWhenStart\": \"string\", \"sStoredProcedureWhenStop\": \"string\", \"sStoredProcedureWhenCompleted\": \"string\", \"sOperationType\": \"string\", \"bReturnPlannedTimeAsTotal\": true, \"bCheckForCharge\": true, \"bMachineTime\": true, \"bPieceWorkTime\": true, \"nFormBeforeStart\": 0, \"nFormAfterStop\": 0, \"sColorCode\": \"string\", \"bReportMaterial\": true, \"bPromptForStartStopTime\": true, \"sAskForRemarkWhen\": \"string\"}"
Response
200 (OK) : success
400 (ERROR) : Error message
Response Body
Error message
DELETE{id}: /operations/{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 operation | Integer |
Curl example
curl -X DELETE "https://smartapi.smarttid.dk/operations/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
| Name | Description | Type |
| sOperationCode | Code of operation | String |
| sDescription | Description | String |
| bExtraPay | Extra Pay | bool |
| bReportScrap | Report Scrap | bool |
| bReportProduced | Report Produced | bool |
| bConcurrent | Concurrent | bool |
| nPricePerHour | Price Per Hour | Number(double) |
| sWorkTypeCode | Work Type Code | String |
| sType | Type | String |
| sConccurentWith | Conccurent With | String |
| bMandatorySetup | Mandatory Setup | bool |
| bOverNight | Over Night | bool |
| bCheckForCertificate | Check For Certificate | bool |
| sOperationGroupCode | Operation Group Code | String |
| sColor | Color | String |
| sStoredProcedureWhenStart | Stored Procedure When Start | String |
| sStoredProcedureWhenStop | Stored Procedure When Stop | String |
| sStoredProcedureWhenCompleted | Stored Procedure When Completed | String |
| sOperationType | Operation Type | String |
| bReturnPlannedTimeAsTotal | Return Planned Time As Total | bool |
| bCheckForCharge | Check For Charge | bool |
| bMachineTime | Machine Time | bool |
| bPieceWorkTime | Piece Work Time | bool |
| nFormBeforeStart | Form Before Start | Number(integer) |
| nFormAfterStart | Form After Start | Number(integer) |
| sColorCode | Color Code | String |
| bReportMaterial | Report Material | bool |
| bPromptForStartStopTime | Prompt For Start Stop Time | bool |
| sAskForRemarkWhen | Ask For Remark When | String |