Skip to content

Instantly share code, notes, and snippets.

@joninvski
Last active June 26, 2019 13:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joninvski/fffcba8793b416a3bea210cd7090cf94 to your computer and use it in GitHub Desktop.
Onfido OpenDay

Convict the scammer 👮

Let's try the Onfido API. We have captured four criminals that we know have spoofed their IDs. Please use onfido to run checks on their ids.

Title First Name Last Name Email Country Address town Date of Birth
Miss Patricia Scarlett patricia@onfido.com PT Barreiro 08/08/1957
Professor Tom Plum tom@onfido.com GB Liverpool 09/11/1948
Mrs Mafalda Peacock mafalda@onfido.com PT Lisboa 28/07/1966
Colonel Ricardo Mustard ricardo@onfido.com PT Malveira 21/02/1977

For each one of the suspects, we ask you to to create a small app that:

  1. create an applicant
  2. submit id card document
  3. create check with a id card report
  4. See the report

Then tells us who is an impostor and why did we consider him as a scammer.

The applicants data and the id card images can be downloaded: open_day.zip.

As extra, and if you want, please add more applicant samples, and try other types of documents and checks we support. Tell us about everything extra that you did.

How to do it

For you to do this you can check onfido's documentation at: https://documentation.onfido.com. The credential to access onfido service will be given to you in a paper.

Please do this using the language of your choice.

CLI example

Here is a small example on how to test the API via the CLI.

Read the csv

cat suspects.csv

Create an applicant

curl -X POST \
  https://api.onfido.com/v2/applicants \
  -H "Authorization: Token token=${TOKEN}" \
  -F title=Mr \
  -F first_name=John \
  -F last_name=Smith \
  -F dob=2013-02-17 \
  -F country=GBR \
  -F 'addresses[][building_number]=100' \
  -F 'addresses[][street]=Main Street' \
  -F 'addresses[][town]=London' \
  -F 'addresses[][postcode]=SW4 6EH' \
  -F 'addresses[][country]=GBR' \
  -F 'addresses[][start_date]=2013-08-10'

Submit a document

curl -X POST \
  https://api.onfido.com/v1/applicants/${APPLICANT_ID}/documents \
   -H "Authorization: Token token=${TOKEN}" \
   -F type=passport \
   -F file=@/path/to/the/file

Submit a check

curl -X POST \
  https://api.onfido.com/v2/applicants/${applicant_id}/checks/ \
   -H "Authorization: Token token=${TOKEN}" \
   -H "Content-Type: application/json" \
   --data '{"type":"standard",   "reports": [{
        "name": "identity",
        "variant": "standard"
    }]}'

If you want we also have some examples on how to do it in python and ruby. Try to do as much as you can without them. Use them in case you get stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment