Add Result

The Add Result API allows you to add a single result to an existing ZetaSafe asset.

You will need to have a valid x-Auth-token allowing you access to the particular asset you are uploading the result to.

URI

Development

https://api.zetasafe.net/dev/ext/result/add

Production

https://api.zetasafe.net/ext/result/add


Method

POST

Content Type

application/json

Body

Optional Fields

  • latitude
  • longitude
  • altitude

All Fields Body

 {"testId":###, 
 "assetId":###, 
 "client":###, 
 "takenByUser":###, 
 "testDate":"###", 
 "latitude":"###", 
 "longitude":"###", 
 "altitude":"###", 
 "resultValue":"###", 
 "resultCompliance":###, 
 "barcodeFileName":###,
 "barcodeScanned":###}

Body Example

{"testId":205226669, 
"assetId":1019802647, 
"client":8608167, 
"takenByUser":1019779751, 
"testDate":"2019-04-04T10:43:00", 
"latitude":"23.4213", 
"longitude":"24.9872", 
"altitude":"25.1337" 
"resultValue":"Four", 
"barcodeFileName":"654636345.jpg",
"resultCompliance":0, 
"barcodeScanned":true}

resultCompliance values are

  • Red - 0
  • Amber - 1
  • Green - 2

testDate format YYYY-MM-DDTHH:MM:SS

 2019-04-04T10:43:00

barcodeFileName is the filename epoc date in millis, of the image captured when the barcode was scanned. This is optional

Responses:

201: Success

   {"recordId":1019816831}

400: Bad Request - an explanation is returned

{"result":"FOREIGN_KEY_INVALID","headings":[{"key":"ok","value":"OK"}],"title":"Record not found","message":"The Test with an ID value of 2052266697 could not be found."}

403: Unauthorised/Access Denied

{
"timestamp": 1555322863458,
"status": 403,
"error": "Forbidden",
"message": "Access Denied",
"path": "v1/test/result/handheld/add"
}

500: Internal Error