require 'csv'
data = CSV.read('suspects.csv')
data.each { |r|
print("Line -> #{r}\n")
}
require 'rest-client'
require 'json'
headers = {
'Authorization' => "Token token=#{token}",
'Content-Type' => "application/json",
}
applicant = RestClient.post('https://api.onfido.com/v2/applicants',
{first_name:'John', last_name:'Smith', email:'abcd@abc.pt'}.to_json,
headers=headers,
)
print(applicant)
require 'rest-client'
require 'json'
headers = {
'Authorization' => "Token token=#{token}",
}
RestClient.post(
"https://api.onfido.com/v2/applicants/#{applicant_id}/documents",
{
file: File.new('path_to_image/image.png'),
type:'passport', multipart: true, side: 'front'
},
headers=headers
)