Skip to content

jboverfelt/passport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passport Build Status Dependencies Status Coverage Status

A Clojure client for the OpenCNAM API.

API Documentation

Installation

Leiningen

[passport "0.1.2"]

Maven

<dependency>
  <groupId>passport</groupId>
  <artifactId>passport</artifactId>
  <version>0.1.2</version>
</dependency>

Gradle

compile "passport:passport:0.1.2"

Usage

OpenCNAM is a lightweight API for caller ID information.

Acceptable phone number formats and error responses are detailed here

The differences between the Hobbyist and Professional tiers are detailed here

Returns a Clojure map containing the Caller ID results or an error and the status code

(ns my.ns
  (:require [passport.core :refer :all]))

;; Hobbyist Tier query

(caller-id "+16502530000")
;; => {:price 0, :uri "/v2/phone/%2B16502530000", :created "2012-10-12T06:53:05.194858",
;;     :number "+16502530000",
;;     :updated "2014-02-20T18:59:27.279412", :name "GOOGLE INC"}

; Query for a number that doesn't exist in the CNAM database

(caller-id "+16502530001")
;; => {:error "No CNAM information available for phone number", :status 404}

;; Professional Tier Query
; sid and token can either be passed in or
; set in OPEN_CNAM_SID and OPEN_CNAM_TOKEN env variables

(caller-id "+16502530000" "sid" "token")

License

Copyright © 2015- Justin Overfelt

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.