I tried to use this API in a web application But it gives the alert message that :
{“status”:“failure”,
“error_code”:402,
“error_message”:“MISSING_ARGUMENTS - access_token is missing”,
“operation_id”:“58584e3589b942c19ac8a6f840eee0d7”}
What can be the reason ?
Join in the discussion - add comment below:
Hello, I get the same error running on my flutter app, but face/detect api works fine on postman. This is my code. i am trying to figure out why that happens
Future<Map<String, dynamic>?> detectFace(File? faceImagFile) async {
String url = “http://api.skybiometry.com/fc/faces/detect”;
try {
var file = await MultipartFile.fromFile(
faceImagFile?.path??"",
filename: “pic.jpg”,
);
final responseData = await _dio.post(url,
data: FormData.fromMap({
‘api_key’: API_KEY,
‘api_secret’:API_SECRET,
‘urls’: file
}), options: Options(
validateStatus: (status) {
if (status! >= 200 && status <= 500) {
return true;
}
return false;
}));
if (kDebugMode) {
print(responseData.data);
}
return responseData.data;
//GoogleMa.fromJson(responseData.data);
} catch (e) {
//final errorMessage = DioExceptions.fromDioError(e as DioError).toString();
if (kDebugMode) {
print(e);
}
}
}
I did mention both in my javascript code for it.My code could be seen at this link : http://postimg.org/image/mhugibvy7/
resolution here is to use GET instead of POST (this worked in the case of the /faces/detect endpoint)
+1
You need to specify API_KEY and API_SECRET in your request.
having the same issue here. it doesn’t occur in the mashape tester but in a rest tester tool (advanced rest client for chrome) i get the same error.
Actually, you can successfully use POST but you must pass all the arguments via FormData (including those API_KEY and API_SECRET).