14-09-2020
Obtains live data from the cameras that are scanning customers trying to access a club. When a camera detects a customers, sends a REST request including an ID of the customer, temperature, turnstile and datetime.
The input parameters are
{
"subjectId": "be9b6de9-e44d-4da8-afb4-84e40ae9e5c8",
// UUID of the subject
"subjectName":"John Appleseed",
"gender":1,
// 0 for females, 1 for males.
"cameraGroup":"",
"cameraTitle":"",
"temperature":36.72,
// Centigrades with two decimals
"datetime":"16-10-2020 14:00:23"
// dd-MM-YYYY HH:mm:ss
}
The response is a json including the following parameters:
{
"hasErrors": 0,
// bool indicating whether occurred any error
"content":{
"subjectId":"be9b6de9-e44d-4da8-afb4-84e40ae9e5c8",
// UUID of the subject
"datetime":"dd-MM-yyyy HH:mm:ss"
//Date time of the action
}
"messages":
[
{"code":400,
"type":4,
"message":"Transacation processed with no errors"
}
]
}
The error codes are the same across the company webservices and are as follows:
var dictionaryRequestDeister = new Dictionary<string, string>
{
{ "xml_code", "dir_ws_facial" },
{ "arg_type", "1" },
{ "arg_data", JsonConvert.SerializeObject(new { data = '{"subjectId":"be9b6de9-e44d-4da8-afb4-84e40ae9e5c8","subjectName":"John Appleseed", "gender":1, "temperature":37.3,"cameraGroup":"","cameraTitle":"CAM_EXT-99-001","datetime":"10-09-2020 16:45:55"}'}
};
var response = await this.client.PostAsync(
this.appConfiguration.DeisterServer,
new FormUrlEncodedContent(dictionaryRequestDeister));
if (!response.IsSuccessStatusCode)
{
resultData.AddMessage(response.StatusCode.ToString(), MessageType.ERROR, response.ReasonPhrase);
return resultData;
}
var stringResult = await response.Content.ReadAsStringAsync();