14-09-2020

Login parameters

Input parameters

Common input parameters for any endpoint

  • xml_code: this is the name of the endppoint
  • arg_type: The value should always be 1, meaning the input is a string.
  • arg_data: This is the input in JSON format.

1. Facial recognition endoint

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.

1.1 Input

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
}

1.2 Response

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"
        }
    ]
}

1.3 Error codes

The error codes are the same across the company webservices and are as follows:

  • 10X: Controlled errors caused by not informing a required field. Example: user not found
  • 20X: Validation errors. Example: User UUID has wrong formatting
  • 30X: Warnings.
  • 40X: Successful code messages
  • 50X: Uncatched errors.

1.4 Working example (.NET)

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();