0.01
No release in over 3 years
Low commit activity in last 3 years
Unofficial Ruby client for the BlockScore Cognito API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10

Runtime

~> 0.2.0
= 2.4.0, ~> 2.4
~> 0.3.0
~> 0.1.5
>= 2.0.3, ~> 2.0
~> 0.11.2
~> 0.0.3
 Project Readme

Cognito Client CircleCI

Unofficial Ruby client for the BlockScore Cognito API. This library was designed using a command-query separation principle.

Installation

Add this line to your application's Gemfile:

gem 'cognito-client'

And then execute:

$ bundle

In your code or in IRB you can include the library with:

require 'cognito/client'

Usage

Creating a client

client = Cognito::Client.create(
  api_key:     'your-api-key',
  api_secret:  'your-api-secret',
  uri:         'https://sandbox.cognitohq.com',
  api_version: '2016-09-01'
)

Creating a profile

profile = client.create_profile

Create an identity search with phone and name

search = client.create_identity_search(
  profile_id:   profile.data.id,
  phone_number: '+14151231234',
  name: { # optional
    first: 'Leslie',
    last:  'Knope'
  }
)

Creating an identity assessment for the search

assessment = search.create_assessment(
  phone_number: '+14151231234',
  name: {
    first: 'Leslie',
    last:  'Doe'
  }
)

Traversing the data

The client automatically links the resource relationships allowing you to make calls like:

search.data.identity_records.first.names.map(&:attributes)

# [
#   { :first=>"LESLIE", :middle=>"BARBARA", :last=>"KNOPE" },
#   {:first=>"LESLIE", :middle=>nil, :last=>"KNOPE-WYATT" }
# ]

Running the test suite

bundle exec rspec

Running the CI tasks

bundle exec rake ci

License

The gem is available as open source under the terms of the MIT License.