Skip to content

Latest commit

 

History

History
1235 lines (892 loc) · 32.3 KB

File metadata and controls

1235 lines (892 loc) · 32.3 KB

Onfido.DefaultApi

All URIs are relative to https://api.onfido.com/v2

Method HTTP request Description
cancelReport POST /checks/{check_id}/reports/{report_id}/cancel This endpoint is for cancelling individual paused reports.
createApplicant POST /applicants Create Applicant
createCheck POST /applicants/{applicant_id}/checks Create a check
createWebhook POST /webhooks Create a webhook
destroyApplicant DELETE /applicants/{applicant_id} Delete Applicant
downloadDocument GET /applicants/{applicant_id}/documents/{document_id}/download Download a documents raw data
downloadLivePhoto GET /live_photos/{live_photo_id}/download Download live photo
findAddresses GET /addresses/pick Search for addresses by postcode
findApplicant GET /applicants/{applicant_id} Retrieve Applicant
findCheck GET /applicants/{applicant_id}/checks/{check_id} Retrieve a Check
findDocument GET /applicants/{applicant_id}/documents/{document_id} A single document can be retrieved by calling this endpoint with the document’s unique identifier.
findLivePhoto GET /live_photos/{live_photo_id} Retrieve live photo
findReport GET /checks/{check_id}/reports/{report_id} A single report can be retrieved using this endpoint with the corresponding unique identifier.
findReportTypeGroup GET /report_type_groups/{report_type_group_id} Retrieve single report type group object
findWebhook GET /webhooks/{webhook_id} Retrieve a Webhook
listApplicants GET /applicants List Applicants
listChecks GET /applicants/{applicant_id}/checks Retrieve Checks
listDocuments GET /applicants/{applicant_id}/documents List documents
listLivePhotos GET /live_photos List live photos
listReportTypeGroups GET /report_type_groups Retrieve all report type groups
listReports GET /checks/{check_id}/reports All the reports belonging to a particular check can be listed from this endpoint.
listWebhooks GET /webhooks List webhooks
restoreApplicant POST /applicants/{applicant_id}/restore Restore Applicant
resumeCheck POST /checks/{check_id}/resume Resume a Check
resumeReport POST /checks/{check_id}/reports/{report_id}/resume This endpoint is for resuming individual paused reports.
updateApplicant PUT /applicants/{applicant_id} Update Applicant
uploadDocument POST /applicants/{applicant_id}/documents Upload a document
uploadLivePhoto POST /live_photos Upload live photo

cancelReport

cancelReport(checkId, reportId)

This endpoint is for cancelling individual paused reports.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var checkId = "checkId_example"; // String | 

var reportId = "reportId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.cancelReport(checkId, reportId, callback);

Parameters

Name Type Description Notes
checkId String
reportId String

Return type

null (empty response body)

createApplicant

Applicant createApplicant(opts)

Create Applicant

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var opts = { 
  'data': new Onfido.Applicant() // Applicant | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createApplicant(opts, callback);

Parameters

Name Type Description Notes
data Applicant [optional]

Return type

Applicant

createCheck

Check createCheck(applicantId, opts)

Create a check

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var opts = { 
  'data': new Onfido.CheckCreationRequest() // CheckCreationRequest | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createCheck(applicantId, opts, callback);

Parameters

Name Type Description Notes
applicantId String
data CheckCreationRequest [optional]

Return type

Check

createWebhook

Webhook createWebhook(opts)

Create a webhook

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var opts = { 
  'data': new Onfido.Webhook() // Webhook | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createWebhook(opts, callback);

Parameters

Name Type Description Notes
data Webhook [optional]

Return type

Webhook

destroyApplicant

destroyApplicant(applicantId)

Delete Applicant

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.destroyApplicant(applicantId, callback);

Parameters

Name Type Description Notes
applicantId String

Return type

null (empty response body)

downloadDocument

File downloadDocument(applicantId, documentId)

Download a documents raw data

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var documentId = "documentId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.downloadDocument(applicantId, documentId, callback);

Parameters

Name Type Description Notes
applicantId String
documentId String

Return type

File

downloadLivePhoto

File downloadLivePhoto(livePhotoId)

Download live photo

Live photos are downloaded using this endpoint.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var livePhotoId = "livePhotoId_example"; // String | The live photo’s unique identifier.


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.downloadLivePhoto(livePhotoId, callback);

Parameters

Name Type Description Notes
livePhotoId String The live photo’s unique identifier.

Return type

File

findAddresses

GenericAddressesList findAddresses(postcode)

Search for addresses by postcode

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var postcode = "postcode_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findAddresses(postcode, callback);

Parameters

Name Type Description Notes
postcode String

Return type

GenericAddressesList

findApplicant

Applicant findApplicant(applicantId)

Retrieve Applicant

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findApplicant(applicantId, callback);

Parameters

Name Type Description Notes
applicantId String

Return type

Applicant

findCheck

Check findCheck(applicantId, checkId)

Retrieve a Check

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var checkId = "checkId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findCheck(applicantId, checkId, callback);

Parameters

Name Type Description Notes
applicantId String
checkId String

Return type

Check

findDocument

Document findDocument(applicantId, documentId)

A single document can be retrieved by calling this endpoint with the document’s unique identifier.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var documentId = "documentId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findDocument(applicantId, documentId, callback);

Parameters

Name Type Description Notes
applicantId String
documentId String

Return type

Document

findLivePhoto

LivePhoto findLivePhoto(livePhotoId)

Retrieve live photo

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var livePhotoId = "livePhotoId_example"; // String | The live photo’s unique identifier.


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findLivePhoto(livePhotoId, callback);

Parameters

Name Type Description Notes
livePhotoId String The live photo’s unique identifier.

Return type

LivePhoto

findReport

Report findReport(checkId, reportId)

A single report can be retrieved using this endpoint with the corresponding unique identifier.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var checkId = "checkId_example"; // String | 

var reportId = "reportId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findReport(checkId, reportId, callback);

Parameters

Name Type Description Notes
checkId String
reportId String

Return type

Report

findReportTypeGroup

ReportTypeGroup findReportTypeGroup(reportTypeGroupId)

Retrieve single report type group object

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var reportTypeGroupId = "reportTypeGroupId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findReportTypeGroup(reportTypeGroupId, callback);

Parameters

Name Type Description Notes
reportTypeGroupId String

Return type

ReportTypeGroup

findWebhook

Webhook findWebhook(webhookId)

Retrieve a Webhook

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var webhookId = "webhookId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findWebhook(webhookId, callback);

Parameters

Name Type Description Notes
webhookId String

Return type

Webhook

listApplicants

ApplicantsList listApplicants(opts)

List Applicants

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var opts = { 
  'page': 56, // Integer | The page to return. Defaults to the first page if omitted. The first page is `page=1`
  'perPage': 56, // Integer | The number of objects per page. Defaults to 20 if omitted.
  'includeDeleted': true // Boolean | Whether to also include applicants scheduled for deletion. Defaults to false if omitted.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listApplicants(opts, callback);

Parameters

Name Type Description Notes
page Integer The page to return. Defaults to the first page if omitted. The first page is `page=1` [optional]
perPage Integer The number of objects per page. Defaults to 20 if omitted. [optional]
includeDeleted Boolean Whether to also include applicants scheduled for deletion. Defaults to false if omitted. [optional]

Return type

ApplicantsList

listChecks

ChecksList listChecks(applicantId, opts)

Retrieve Checks

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var opts = { 
  'page': 56, // Integer | The page to return. Defaults to the first page if omitted. The first page is `page=1`
  'perPage': 56 // Integer | The number of objects per page. Defaults to 20 if omitted.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listChecks(applicantId, opts, callback);

Parameters

Name Type Description Notes
applicantId String
page Integer The page to return. Defaults to the first page if omitted. The first page is `page=1` [optional]
perPage Integer The number of objects per page. Defaults to 20 if omitted. [optional]

Return type

ChecksList

listDocuments

DocumentsList listDocuments(applicantId)

List documents

All documents belonging to an applicant can be listed from this endpoint

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listDocuments(applicantId, callback);

Parameters

Name Type Description Notes
applicantId String

Return type

DocumentsList

listLivePhotos

LivePhotosList listLivePhotos(applicantId)

List live photos

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | The id of the applicant the live photos belongs to.


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listLivePhotos(applicantId, callback);

Parameters

Name Type Description Notes
applicantId String The id of the applicant the live photos belongs to.

Return type

LivePhotosList

listReportTypeGroups

ReportTypeGroupsList listReportTypeGroups()

Retrieve all report type groups

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listReportTypeGroups(callback);

Parameters

This endpoint does not need any parameter.

Return type

ReportTypeGroupsList

listReports

ReportsList listReports(checkId)

All the reports belonging to a particular check can be listed from this endpoint.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var checkId = "checkId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listReports(checkId, callback);

Parameters

Name Type Description Notes
checkId String

Return type

ReportsList

listWebhooks

WebhooksList listWebhooks()

List webhooks

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listWebhooks(callback);

Parameters

This endpoint does not need any parameter.

Return type

WebhooksList

restoreApplicant

restoreApplicant(applicantId)

Restore Applicant

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.restoreApplicant(applicantId, callback);

Parameters

Name Type Description Notes
applicantId String

Return type

null (empty response body)

resumeCheck

resumeCheck(checkId)

Resume a Check

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var checkId = "checkId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.resumeCheck(checkId, callback);

Parameters

Name Type Description Notes
checkId String

Return type

null (empty response body)

resumeReport

resumeReport(checkId, reportId)

This endpoint is for resuming individual paused reports.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var checkId = "checkId_example"; // String | 

var reportId = "reportId_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.resumeReport(checkId, reportId, callback);

Parameters

Name Type Description Notes
checkId String
reportId String

Return type

null (empty response body)

updateApplicant

Applicant updateApplicant(applicantId, opts)

Update Applicant

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var opts = { 
  'data': new Onfido.Applicant() // Applicant | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateApplicant(applicantId, opts, callback);

Parameters

Name Type Description Notes
applicantId String
data Applicant [optional]

Return type

Applicant

uploadDocument

Document uploadDocument(applicantId, type, opts)

Upload a document

Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | 

var type = "type_example"; // String | 

var opts = { 
  'side': "side_example", // String | 
  'file': "/path/to/file.txt" // File | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.uploadDocument(applicantId, type, opts, callback);

Parameters

Name Type Description Notes
applicantId String
type String
side String [optional]
file File [optional]

Return type

Document

uploadLivePhoto

LivePhoto uploadLivePhoto(applicantId, file, opts)

Upload live photo

You can upload live photos to this endpoint. Like document upload, files must be uploaded as a multipart form. Valid file types are jpg, png and pdf. The file size must be between 32KB and 10MB. Live photos are validated at the point of upload to check that they contain exactly one face. This validation can be disabled by setting the advanced_validation argument to false.

Example

var Onfido = require('onfido');
var defaultClient = Onfido.ApiClient.default;

// Configure API key authorization: Token
var Token = defaultClient.authentications['Token'];
Token.apiKey = 'token=' + 'YOUR API KEY';
Token.apiKeyPrefix = 'Token';

var apiInstance = new Onfido.DefaultApi();

var applicantId = "applicantId_example"; // String | The applicant_id to associate the live photo to.

var file = "/path/to/file.txt"; // File | The file to be uploaded.

var opts = { 
  'advancedValidation': true // Boolean | Validates that the live photo contains exactly one face.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error.response.body);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.uploadLivePhoto(applicantId, file, opts, callback);

Parameters

Name Type Description Notes
applicantId String The applicant_id to associate the live photo to.
file File The file to be uploaded.
advancedValidation Boolean Validates that the live photo contains exactly one face. [optional]

Return type

LivePhoto