Skip to content

Passport Photo API

Make id photo end to end

API Functionality: Make ID Photo based on given photo and spec code. The API internally

  1. Remove background of the original photo
  2. Crop the input image based on id/passport/visa photo requirements
  3. Adjust photo size to meet id/passport/visa photo requirements

All of the above are done with one API call (/v2/makeIdPhoto).

JSON
POST /v2/makeIdPhoto

Body {
  "apiKey": "string", 
  "apiSecret": "string",
  "imageBase64": "string", // image base64 data
  "specCode": "string" // photo spec, you could use "australia-passport" for testing. See the last section for more details
}

Response {
  "photoUuid": "string", // the unqiue id of the id photo
  "waterMark": boolean, // if the ID photo has marks and watermark
  "idPhotoUrl": "string", // the url of created ID photo
  "originalPhotoUrl": "string", // the url of the original photo
  "issues": List[String] // issues found in the photo. See "Issue Code" for more information
}

Request signed url

JSON
POST /v2/getSignedUrl

Body {
  "apiKey": "string", 
  "apiSecret": "string",
  "specCode": "us-passport", // photo spec code
  // valid value in photoTypeList:
  // ID_PHOTO, default value, will return jpg format
  // ID_PHOTO_PNG, will return png format
  // ID_PHOTO_ORIGINAL_BG, will not remove background
  "photoTypeList": ["ID_PHOTO"]
}

Response {
  "signedUrl": "https://idp-v2.idphotoapp.com/v2/getIdPhotoWatermark/××××××××"
}

Request watermark photo

Description: make an ID photo with watermark

JSON
// signed url will come from /v2/getSignedUrl
POST https://idp-v2.idphotoapp.com/v2/getIdPhotoWatermark/××××××××

Body {
  "imageBase64": "string", // photo base64 data
}

Response {
  "photoUuid": "2312211447ZFGUEOWX", // each photo has a unique ID
  "watermark": true,  // indicating marks and watermark in the outcome photo.
  "originalPhotoUrl": "string", // user original photo url
  "photoDpi": 300, // photo dpi
  "photoWidthPx": 600, // photo width in pixel
  "photoHeightPx": 600, // photo height in pixel
  "photoWidthMm": 51, // photo width in mm
  "photoHeightMm": 51, // photo height in mm
  "issues": [], // the issues in the original photo & ID Photo.
  "idPhotoUrl": "string" // the S3 based URL for access the ID Photo, in JPG format
}

3ce34219-c54e-428e-8f2c-d5469b432100

Request no watermark photo

Description: get the ID photo without watermark based on photoUuid

JSON
POST /v2/getIdPhotoNoWatermark

Body {
  "apiKey": "string", 
  "apiSecret": "string",
  "photoUuid": "2206300456S04X8RV94J"
}

Response {
  "idPhotoUrl": "string", // the S3 based URL for access the ID Photo, in JPG format
  "idPhotoPngUrl": "string", // the S3 based URL for access the ID Photo, in PNG format
  "idPhotoOriginalBgUrl": "string"
}

Request no background photo

JSON
POST /v2/getFullPhotoNoBg

Body {
  "apiKey": "string", 
  "apiSecret": "string",
  "photoUuid": "2206300456S04X8RV94J"
}

Response {
  "fullPhotoNoBgUrl": "string" // no background photo
}

Request to remake photo

Reference the response of Request watermark photo

JSON
POST /v2/remake

Body {
  "apiKey": "string", 
  "apiSecret": "string",
  "originalPhotoUuid": "2206300456S04X8RV94J", // original photoUuid
  "imageBase64": "string",  // photo base64 data
  "photoTypeList": ["ID_PHOTO"] // reference /v2/getSignedUrl
}

Response {
    "photoUuid": "2312211447ZFGUEOWX", // new photo uuid
    "watermark": false,
    "originalPhotoUrl": "string",
    "photoDpi": 300,
    "photoWidthPx": 600,
    "photoHeightPx": 600,
    "photoWidthMm": 51,
    "photoHeightMm": 51, 
    "issues": [],
    "idPhotoUrl": "string",
}