Face Recognition

post
Prep Upload

https://testapi.smileidentity.com/v1/upload
This endpoint creates a job record
Request
Response
Request
Body Parameters
file_name
required
string
This is the name of the zip file that will be uploaded in the PUT request to the upload URL
sec_key
required
string
This is an access signature. Steps to calculate this can be found at https://docs.smileidentity.com/further-reading/api-access
timestamp
required
number
The timestamp that was used to calculate the sec_key (in milliseconds)
smile_client_id
required
string
This is your partner id which can be found at https://test-smileid.herokuapp.com/api-key on the navigation side panel of the Smile ID partner portal
partner_params
required
object
This is a JSON object type parameter that contains the partner defined parameters - What type of job to perform - An identifier to keep track of the job (cannot be used more than once) - An identifier to keep track of the job (can only be used again using a 2fa [job type 2])
model_parameters
optional
object
This parameter is specific to mobile SDK, can be left as an empty JSON object
callback_url
optional
string
An endpoint on the partner side where Smile ID will send the results of a job to in the form of a POST request (with no authorization headers)
Response
200: OK
A record has now been created waiting for the job to be processed once the required data has been uploaded
{
"upload_url": "https://smile-uploads-test.s3.us-west-2.amazonaws.com/videos/<partner_id>/<partner_id>-<smile_job_id>-<random hash>/selfie.zip?AWSAccessKeyId=<>&Content-Type=application%2Fzip&Expires=1598449184&Signature=<>&x-amz-security-token=<>&x-amz-server-side-encryption=AES256",
"ref_id": "<partner_id>-<smile_job_id>-<random hash>",
"smile_job_id": "0000000001",
"camera_config": "null", ---sdk specific---
"code": "2202"
}
400: Bad Request
Trying to use a job_id in partner_params that has already been used
{
"error": "Job already exists. Did you mean to set the retry flag to true?",
"code": "2215"
}

Example Request

{
"file_name": "attachments.zip",
"sec_key": "<calculated sec_key>",
"timestamp": <timestamp used to calc sec_key parameter e.g. 1574065724378>,
"smile_client_id": "<partner id>",
"partner_params":
{
"job_type":<job type e.g. 1 | 2 | 4 | 8>
"job_id":"job_09876",
"user_id":"user_12345",
},
"model_parameters": {},
"callback_url": "https://<partner side callback URL>/"
}

In the response body to the prep upload request, you will receive n AWS s3 bucket that will be expecting the images for face recognition. The URL is structured like:

"https://smile-uploads-test.s3.us-west-2.amazonaws.com/videos/ <partner_id>/<partner_id>-<smile_job_id>-<random hash>/attachments.zip ?AWSAccessKeyId=<> &Content-Type=application%2Fzip &Expires=1598449184&Signature=<> &x-amz-security-token=<>&x-amz-server-side-encryption=AES256"

info.json to be sent in the PUT request for the upload URL sent back in the response body

{
"package_information":
{
"apiVersion": {
"buildNumber": 0,
"majorVersion": 2,
"minorVersion": 0
}
},
"id_info":
{
"dob":"<dob in ID type specific format>",
"country":"<country code e.g. KE>",
"entered":true <job type 1> | false,
"id_type":"smile ID type keyword e.g. NATIONAL_ID",
"id_number":"00000000",
"last_name":"Hossain",
"first_name":"Noosrat",
"middle_name":""
},
"images": [
{
<use either image or file_name, both cannot be used at the same time>
"image_type_id": <0 | 2 |,
"image": "<base64 string of image>",
"file_name": "<name of file in the zip that will be uploaded>"
}
]
}

Parameters

Parameter

Description

package_information

just use what is in the example the above

id_info

see https://docs.smileidentity.com/general/supported-id-types

images

not used if files are uploaded. for image list structure see https://docs.smileidentity.com/products/web-api/overview in an image item all 3 parameters will exist: {

"image_type_id": 2,

"image": "<base64 string of image>",

"file_name": "<name of file in the zip that will be uploaded>"

}

Depending in the image_type_id one of the other parameters will be an empty string (“”)

Uploading job requirements

Zip up the info.json file and name it the file name sent in the request

put
Upload zip containing images

https://smile-uploads-test.s3.us-west-2.amazonaws.com/videos/<partner_id>/<partner_id>-<smile_job_id>-<random hash>/attachments.zip
The request body will be of type binary (the zip file)
Request
Response
Request
Path Parameters
AWSAccessKeyId
optional
string
Given
Expires
optional
string
Given
Signature
optional
string
Given
x-amz-security-token
optional
string
Given
x-amz-server-side-encryption
optional
string
Given
Headers
Content-Type
optional
string
application/zip
Response
200: OK
Zip Folder Structure