The Onfido API is used to submit check requests.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 2.0.0
- Package version: 2.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/onfido/api-python-client.git(you may need to run pip with root permission: sudo pip install git+https://github.com/onfido/api-python-client.git)
Then import the package:
import onfido Install via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import onfidoPlease follow the installation procedure and then run the following:
import sys
import onfido
import datetime
from pprint import pprint
from onfido.rest import ApiException
configuration = onfido.Configuration()
configuration.api_key['Authorization'] = 'token=' + 'YOUR API TOKEN'
configuration.api_key_prefix['Authorization'] = 'Token'
# Limit the at-rest region, if needed (optional, see https://documentation.onfido.com/#regions)
# configuration.host = configuration.get_host_from_settings(1, {'region': 'us'})
api = onfido.DefaultApi(onfido.ApiClient(configuration))
# Setting applicant details
applicant = onfido.Applicant(first_name='John', last_name='Smith')
applicant.dob = datetime.date(1980, 1, 22)
applicant.country = 'GBR'
address = onfido.Address()
address.building_number = '100'
address.street = 'Main Street'
address.town = 'London'
address.postcode = 'SW4 6EH'
address.country = 'GBR'
applicant.addresses = [address];
# Setting check details
check = onfido.Check(type='express')
report = onfido.Report(name='identity')
check.reports = [report];
try:
applicant_data = api.create_applicant(applicant)
applicant_id = applicant_data.id
check_data = api.create_check(applicant_id, check)
pprint(check_data)
except ApiException as e:
pprint(e.body)All URIs are relative to https://api.onfido.com/v2
- Address
- Applicant
- ApplicantsList
- Check
- CheckCommon
- CheckWithReportIds
- ChecksList
- Document
- DocumentsList
- Error
- GenericAddress
- GenericAddressesList
- IdNumber
- LivePhoto
- LivePhotosList
- Report
- ReportDocument
- ReportOption
- ReportType
- ReportTypeGroup
- ReportTypeGroupsList
- ReportsList
- Webhook
- WebhooksList
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
