The Onfido API is used to submit check requests.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 2.0.0
- Package version: 3.0.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
PHP 7.1 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/onfido/api-php-client.git"
}
],
"require": {
"onfido/api-php-client": "^3.0.0"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/onfido-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Token
$config = Onfido\Configuration::getDefaultConfiguration();
$config->setApiKey('Authorization', 'token=' . 'YOUR API KEY');
$config->setApiKeyPrefix('Authorization', 'Token');
// Limit the at-rest region, if needed (optional, see https://documentation.onfido.com/#regions)
// $config->setHost($config->getHostFromSettings(1, array("region" => "us")));
$api = new Onfido\Api\DefaultApi(null, $config);
// Setting applicant details
$applicant = new Onfido\Model\Applicant();
$applicant->setFirstName('John');
$applicant->setLastName('Smith');
$applicant->setDob(new DateTime('1980-01-22'));
$applicant->setCountry('GBR');
$address = new Onfido\Model\Address();
$address->setBuildingNumber('100');
$address->setStreet('Main Street');
$address->setTown('London');
$address->setPostcode('SW4 6EH');
$address->setCountry('GBR');
$applicant->setAddresses(array($address));
// Setting check details
$check = new Onfido\Model\Check();
$check->setType('express');
$report = new Onfido\Model\Report();
$report->setName('identity');
$check->setReports(array($report));
try {
$applicantData = $api->createApplicant($applicant);
$applicantId = $applicantData->getId();
$checkData = $api->createCheck($applicantId, $check);
print_r($checkData);
} catch (Exception $e) {
print_r($e->getResponseBody());
}
?>
All URIs are relative to https://api.onfido.com/v2
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | cancelReport | POST /checks/{check_id}/reports/{report_id}/cancel | This endpoint is for cancelling individual paused reports. |
DefaultApi | createApplicant | POST /applicants | Create Applicant |
DefaultApi | createCheck | POST /applicants/{applicant_id}/checks | Create a check |
DefaultApi | createWebhook | POST /webhooks | Create a webhook |
DefaultApi | destroyApplicant | DELETE /applicants/{applicant_id} | Delete Applicant |
DefaultApi | downloadDocument | GET /applicants/{applicant_id}/documents/{document_id}/download | Download a documents raw data |
DefaultApi | downloadLivePhoto | GET /live_photos/{live_photo_id}/download | Download live photo |
DefaultApi | downloadLiveVideo | GET /live_videos/{live_video_id}/download | Download live video |
DefaultApi | findAddresses | GET /addresses/pick | Search for addresses by postcode |
DefaultApi | findApplicant | GET /applicants/{applicant_id} | Retrieve Applicant |
DefaultApi | findCheck | GET /applicants/{applicant_id}/checks/{check_id} | Retrieve a Check |
DefaultApi | findDocument | GET /applicants/{applicant_id}/documents/{document_id} | A single document can be retrieved by calling this endpoint with the document’s unique identifier. |
DefaultApi | findLivePhoto | GET /live_photos/{live_photo_id} | Retrieve live photo |
DefaultApi | findLiveVideo | GET /live_videos/{live_video_id} | Retrieve live video |
DefaultApi | findReport | GET /checks/{check_id}/reports/{report_id} | A single report can be retrieved using this endpoint with the corresponding unique identifier. |
DefaultApi | findReportTypeGroup | GET /report_type_groups/{report_type_group_id} | Retrieve single report type group object |
DefaultApi | findWebhook | GET /webhooks/{webhook_id} | Retrieve a Webhook |
DefaultApi | listApplicants | GET /applicants | List Applicants |
DefaultApi | listChecks | GET /applicants/{applicant_id}/checks | Retrieve Checks |
DefaultApi | listDocuments | GET /applicants/{applicant_id}/documents | List documents |
DefaultApi | listLivePhotos | GET /live_photos | List live photos |
DefaultApi | listLiveVideos | GET /live_videos | List live videos |
DefaultApi | listReportTypeGroups | GET /report_type_groups | Retrieve all report type groups |
DefaultApi | listReports | GET /checks/{check_id}/reports | All the reports belonging to a particular check can be listed from this endpoint. |
DefaultApi | listWebhooks | GET /webhooks | List webhooks |
DefaultApi | restoreApplicant | POST /applicants/{applicant_id}/restore | Restore Applicant |
DefaultApi | resumeCheck | POST /checks/{check_id}/resume | Resume a Check |
DefaultApi | resumeReport | POST /checks/{check_id}/reports/{report_id}/resume | This endpoint is for resuming individual paused reports. |
DefaultApi | updateApplicant | PUT /applicants/{applicant_id} | Update Applicant |
DefaultApi | uploadDocument | POST /applicants/{applicant_id}/documents | Upload a document |
DefaultApi | uploadLivePhoto | POST /live_photos | Upload live photo |
- Address
- Applicant
- ApplicantsList
- Check
- CheckCommon
- CheckWithReportIds
- ChecksList
- Document
- DocumentsList
- Error
- GenericAddress
- GenericAddressesList
- IdNumber
- LivePhoto
- LivePhotosList
- LiveVideo
- LiveVideosList
- Report
- ReportDocument
- ReportOption
- ReportType
- ReportTypeGroup
- ReportTypeGroupsList
- ReportsList
- Webhook
- WebhooksList
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header