Links

API Documentation

Face Recognition API

post
https://api.iapp.co.th
/face_recog_single
Face Recognition For Single Face

Parameter in Response

Name
Type
Description
bbox
Dictionary
Face bounding boxes of personal
xmax
Float
Maximum value in the x-axis
xmin
Float
Minimum value in the x-axis
ymax
Float
Maximum value in the y-axis
ymin
Float
Minimum value in the y-axis
company
String
The company name
detection_score
String
Detection score of face in image.
message
String
The processing status
name
String
The personal name
process_time
Float
The processing time
recognition_score
Float
Recognition score of face in image.

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
curl --location -g --request POST 'https://api.iapp.co.th/face_recog_single' \
--header 'apikey: {Your API Key}' \
--form 'company="{Your Company Name}"' \
--form '[email protected]"{Your Image File Path}"'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/face_recog_single")
.header("apikey", "{Your API Key}")
.field("file", new File("{Your Image File Path}"))
.field("company", "{Your Company Name}")
.asString();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.iapp.co.th/face_recog_single',
'headers': {
'apikey': '{Your API Key}'
},
formData: {
'file': {
'value': fs.createReadStream('{Your Image File Path}'),
'options': {
'filename': '{Your Image File Name}'
'contentType': null
}
},
'company': '{Your Company Name}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/face_recog_single"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"apikey": @"{Your API Key}"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"file", @"fileName": @"{Your Image File Path}" },
@{ @"name": @"company", @"value": @"{Your Company Name}" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.iapp.co.th/face_recog_single');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apikey' => '{Your API Key}'
));
$request->addPostParameter(array(
'company' => '{Your Company Name}'
));
$request->addUpload('file', '{Your Image File Path}', '{Your Image File Name}', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
import requests
url = "https://api.iapp.co.th/face_recog_single"
payload={'company': '{Your Company Name}'}
files=[
('file',('{Your Image File Name}',open('{Your Image File Path}','rb'),'image/jpeg'))
]
headers = {
'apikey': '{Your API Key}'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
post
https://api.iapp.co.th
/face_recog_multi
Face Recognition For Multiple Face

Parameter in Response

Name
Type
Description
message
String
The processing status
process_time
Float
The processing time
result
Array
The data in dictionary for each personal
bbox
Dictionary
Face bounding boxes of personal
xmax
Float
Maximum value in the x-axis
xmin
Float
Minimum value in the x-axis
ymax
Float
Maximum value in the y-axis
ymin
Float
Minimum value in the y-axis
company
String
The company name
detection_score
Float
Detection score of face in image.
name
String
The personal name
recognition_score
Float
Recognition score of face in image.

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
curl --location -g --request POST 'https://api.iapp.co.th/face_recog_multi' \
--header 'apikey: {Your API Key}' \
--form 'company="{Your Company Name}"' \
--form '[email protected]"{Your Image File Path}"'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/face_recog_multi")
.header("apikey", "{Your API Key}")
.field("file", new File("{Your Image File Path}"))
.field("company", "{Your Company Name}")
.asString();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.iapp.co.th/face_recog_multi',
'headers': {
'apikey': '{Your API Key}'
},
formData: {
'file': {
'value': fs.createReadStream('{Your Image File Path}'),
'options': {
'filename': '{Your Image File Name}'
'contentType': null
}
},
'company': '{Your Company Name}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/face_recog_multi"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"apikey": @"{Your API Key}"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"file", @"fileName": @"{Your Image File Path}" },
@{ @"name": @"company", @"value": @"{Your Company Name}" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.iapp.co.th/face_recog_multi');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apikey' => '{Your API Key}'
));
$request->addPostParameter(array(
'company' => '{Your Company Name}'
));
$request->addUpload('file', '{Your Image File Path}', '{Your Image File Name}', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
import requests
url = "https://api.iapp.co.th/face_recog_multi"
payload={'company': '{Your Company Name}'}
files=[
('file',('{Your Image File Name}',open('{Your Image File Path}','rb'),'image/jpeg'))
]
headers = {
'apikey': '{Your API Key}'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
post
https://api.iapp.co.th
/face_recog_facecrop
Face Recognition For Only Face

Parameter in Response

Name
Type
Description
company
String
The company name
message
String
The processing status
name
String
The personal name
process_time
Float
The processing time
recognition_score
Float
Recognition score of face in image.

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
curl --location -g --request POST 'https://api.iapp.co.th/face_recog_facecrop' \
--header 'apikey: {Your API Key}' \
--form 'company="{Your Company Name}"' \
--form '[email protected]"{Your Image File Path}"'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/face_recog_facecrop")
.header("apikey", "{Your API Key}")
.field("file", new File("{Your Image File Path}"))
.field("company", "{Your Company Name}")
.asString();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.iapp.co.th/face_recog_facecrop',
'headers': {
'apikey': '{Your API Key}'
},
formData: {
'file': {
'value': fs.createReadStream('{Your Image File Path}'),
'options': {
'filename': '{Your Image File Name}'
'contentType': null
}
},
'company': '{Your Company Name}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/face_recog_facecrop"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"apikey": @"{Your API Key}"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"file", @"fileName": @"{Your Image File Path}" },
@{ @"name": @"company", @"value": @"{Your Company Name}" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.iapp.co.th/face_recog_facecrop');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apikey' => '{Your API Key}'
));
$request->addPostParameter(array(
'company' => '{Your Company Name}'
));
$request->addUpload('file', '{Your Image File Path}', '{Your Image File Name}', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
import requests
url = "https://api.iapp.co.th/face_recog_facecrop"
payload={'company': '{Your Company Name}'}
files=[
('file',('{Your Image File Name}',open('{Your Image File Path}','rb'),'image/jpeg'))
]
headers = {
'apikey': '{Your API Key}'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Face Recognition Tool

post
https://api.iapp.co.th
/face_recog_add
Adding Face

Parameter in Response

Name
Type
Description
company
String
The company name
face
String
Face image in base64 format
face_id
String
The ID of face for remove
message
String
The processing status
name
String
The personal name

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
curl --location -g --request POST 'https://api.iapp.co.th/face_recog_add' \
--header 'apikey: {Your API Key}' \
--form '[email protected]"{Your Image File Path}"' \
--form 'company="{Your Company Name}"' \
--form 'name="{Personal Name}"' \
--form 'password="{Your Company Password}"'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/face_recog_add")
.header("apikey", "{Your API Key}")
.field("file", new File("{Your Image File Path}"))
.field("company", "{Your Company Name}")
.field("name", "{Personal Name}")
.field("password", "{Your Company Password}")
.asString();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.iapp.co.th/face_recog_add',
'headers': {
'apikey': '{Your API Key}'
},
formData: {
'file': {
'value': fs.createReadStream('{Your Image File Path}'),
'options': {
'filename': '{Your Image File Name}',
'contentType': null
}
},
'company': '{Your Company Name}',
'name': '{Personal Name}',
'password': '{Your Company Password}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/face_recog_add"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"apikey": @"{Your API Key}"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"file", @"fileName": @"{Your Image File Path}" },
@{ @"name": @"company", @"value": @"{Your Company Name}" },
@{ @"name": @"name", @"value": @"{Personal Name}" },
@{ @"name": @"password", @"value": @"{Your Company Password}" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.iapp.co.th/face_recog_add');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apikey' => '{Your API Key}'
));
$request->addPostParameter(array(
'company' => '{Your Company Name}',
'name' => '{Personal Name}',
'password' => '{Your Company Password}'
));
$request->addUpload('file', '{Your Image File Path}', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
import requests
url = "https://api.iapp.co.th/face_recog_add"
payload={'company': '{Your Company Name}',
'name': '{Personal Name}',
'password': '{Your Company Password}'}
files=[
('file',('{Your Image File Name}',open('{Your Image File Path}','rb'),'image/jpeg'))
]
headers = {
'apikey': '{Your API Key}'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
post
https://api.iapp.co.th
/face_recog_import
Importing Feature File

Parameter in Response

Name
Type
Description
company
String
The company name
face
String
Face image in base64 format
face_id
String
The ID of face for remove
message
String
The processing status
name
String
The personal name

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
curl --location -g --request POST 'https://api.iapp.co.th/face_recog_import' \
--header 'apikey: {Your API Key}' \
--form '[email protected]"{Your Feature CSV File Path}"' \
--form 'company="{Your Company Name}"' \
--form 'password="{Your Company Password}"'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/face_recog_import")
.header("apikey", "{Your API Key}")
.field("file", new File("{Your Feature CSV File Path}"))
.field("company", "{Your Company Name}")
.field("password", "{Your Company Password}")
.asString();
var request = require('request');
var fs = require('fs');