0

I'm trying to upload a face using the POST method using this endpoint:

http://\<ip\>/ISAPI/Intelligent/FDLib/FaceDataRecord?format=json

And using this body:

{
"faceUR": "http://example.com/path/to/image.jpg",`
"faceLibType": "blackFD",
"FDID": 1,
"FPID": "A216627674",
"featurePointType": "face"
}

But the PostMan console always returns me the same error:

{
 "statusCode": 6,
 "statusString": "Invalid Content",
 "subStatusCode": "MessageParametersLack",
 "errorCode": 1610612761,
 "errorMsg": "FDID"
}

and I don ́t know which value ISAPI expects to recieve on FDID. Maybe a specific value or data type?

I purchased a new facial hkvision recognition device. The current system works with a couple of devices from a couple of years ago and apparently the structure to communicate between them is diferent. The current system uses the following method in PHP to upload an image using ISAPI, but unlike previous models of facial recognition devices, the new one does not accept the value of 1 in the FDID field.

// Upload Face 
public function setUserImageUrl($device, $employeeNo, $imageUrl)
{
 $host = $device;
 $url = 'ISAPI/Intelligent/FDLib/FaceDataRecord?format=json';
 $body = '{
 "faceURL": "' . $imageUrl . '",
 "faceLibType": "blackFD",
 "FDID": 1,
 "FPID": "' . $employeeNo . '",
 "featurePointType":"face"
 }';
 $response = $this->request('POST', $host, $url, $body);
 if (!$response) {
 log::info('img fail');
 return false;
 }
 return json_decode($response);
}
Olivier
19.9k1 gold badge12 silver badges34 bronze badges
asked Aug 28, 2024 at 23:21
3
  • 5
    Don't manually create JSON. Use json_encode instead with array value Commented Aug 29, 2024 at 7:43
  • This doesn't have much to do with ISAPI - that's just an interface to allow certain types of code to be run in IIS. What we need to know about is the specific module you're using, and its specification, and what parameters it expects etc. Do you have some documentation? Commented Aug 29, 2024 at 8:36
  • As above, don't build JSON by hand like this. It's fiddly and error-prone. Build a PHP object/array and then json_encode() it, for fully reliable results. Commented Nov 7, 2024 at 13:46

2 Answers 2

0

FDID is a string type.

"FDID" : "1"
answered Nov 7, 2024 at 13:39
Sign up to request clarification or add additional context in comments.

Comments

-1

There are many reasons why you faced such issues. For example, the FDID typically refers to the Face Database ID. It's possible that the value 1 is not valid because it does not correspond to an existing face library in your new device.

Try this code, I improved it a little bit

public function setUserImageUrl($device, $employeeNo, $imageUrl, $FDID)
{
 $host = $device;
 $url = 'ISAPI/Intelligent/FDLib/FaceDataRecord?format=json';
 $body = '{
 "faceURL": "' . $imageUrl . '",
 "faceLibType": "blackFD",
 "FDID": ' . $FDID . ',
 "FPID": "' . $employeeNo . '",
 "featurePointType":"face"
 }';
 $response = $this->request('POST', $host, $url, $body);
 if (!$response) {
 log::info('img fail');
 return false;
 }
 return json_decode($response);
}
Cody Gray
246k53 gold badges514 silver badges591 bronze badges
answered Aug 29, 2024 at 12:04

1 Comment

Don't build JSON by hand like this. It's fiddly and error-prone. Build a PHP object/array and then json_encode() it, for fully reliable results.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.