/onfido-api-client

This is an auto-generated client library for Onfido API v2

Primary LanguagePythonApache License 2.0Apache-2.0

onfido

The Onfido API is used to submit background checking requests

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 1.0.1
  • Build date: 2017-03-21T18:08:01.556Z
  • Build package: class io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

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 

Setuptools

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 onfido

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import onfido
from onfido.rest import ApiException
from pprint import pprint

# Configure API key authorization: Token
onfido.configuration.api_key['Authorization'] = 'token=' + 'YOUR_API_KEY'
onfido.configuration.api_key_prefix['Authorization'] = 'Token'
# create an instance of the API class
api_instance = onfido.DefaultApi()

# setting applicant details
applicant = onfido.Applicant()
applicant.first_name = 'John'
applicant.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 request details
check = onfido.CheckCreationRequest()
check.type = 'express'

report = onfido.Report()
report.name = 'identity'

check.reports = [report];

try: 
    # Create Applicant
    api_response = api_instance.create_applicant(data=applicant)
    applicant_id = api_response.id
    api_response = api_instance.create_check(applicant_id, data=check)
    pprint(api_response)
except ApiException as e:
    pprint(e.body)

Documentation for API Endpoints

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

Class Method HTTP request Description
DefaultApi cancel_report POST /checks/{check_id}/reports/{report_id}/cancel This endpoint is for cancelling individual paused reports.
DefaultApi create_applicant POST /applicants Create Applicant
DefaultApi create_check POST /applicants/{applicant_id}/checks Create a check
DefaultApi destroy_applicant DELETE /applicants/{applicant_id} Delete Applicant
DefaultApi download_document GET /applicants/{applicant_id}/documents/{document_id}/download Download a documents raw data
DefaultApi find_applicant GET /applicants/{applicant_id} Retrieve Applicant
DefaultApi find_check GET /applicants/{applicant_id}/checks/{check_id} Retrieve a Check
DefaultApi find_document GET /applicants/{applicant_id}/documents/{document_id} A single document can be retrieved by calling this endpoint with the document’s unique identifier.
DefaultApi find_report GET /checks/{check_id}/reports/{report_id} A single report can be retrieved using this endpoint with the corresponding unique identifier.
DefaultApi find_report_type_group GET /report_type_groups/{report_type_group_id} Retrieve single report type group object
DefaultApi list_applicants GET /applicants List Applicants
DefaultApi list_checks GET /applicants/{applicant_id}/checks Retrieve Checks
DefaultApi list_documents GET /applicants/{applicant_id}/documents List documents
DefaultApi list_report_type_groups GET /report_type_groups Retrieve all report type groups
DefaultApi list_reports GET /checks/{check_id}/reports All the reports belonging to a particular check can be listed from this endpoint.
DefaultApi resume_check POST /checks/{check_id}/resume Resume a Check
DefaultApi resume_report POST /checks/{check_id}/reports/{report_id}/resume This endpoint is for resuming individual paused reports.
DefaultApi update_applicant PUT /applicants/{applicant_id} Update Applicant
DefaultApi upload_document POST /applicants/{applicant_id}/documents Upload a document

Documentation For Models