README.md in fullcontact-0.14.0 vs README.md in fullcontact-0.15.0
- old
+ new
@@ -7,12 +7,12 @@
[![Code Climate](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby/badges/gpa.svg)](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby)
[![Test Coverage](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby/badges/coverage.svg)](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby)
Changes
-------
-- 0.14.0
- - Remove `plissken` gem to support Rails 5 (#42)
+- 0.15.0 - Add header-based auth via `config.auth_type = :header` control.
+- 0.14.0 - Remove `plissken` gem to support Rails 5 (#42)
- 0.13.0
- Raise `ArgumentError` if query by Facebook ID/username is used.
- Remove deprecated messages.
- 0.12.0 - `include_headers_in_response = true` includes response headers in returned payload
- Accessible as `http_headers` in response. Also accessible on thrown errors (e.g. RateLimited)
@@ -43,11 +43,11 @@
# This could go in an initializer
FullContact.configure do |config|
config.api_key = 'fullcontact_api_key_goes_here'
end
-
+
# Get information about an email address
person = FullContact.person(email: 'bart@fullcontact.com')
```
All returned values are Hashie structs. You can access fields as if they were fields:
@@ -62,25 +62,34 @@
```ruby
# Get person's family_name
person.to_hash['contact_info']['family_name']
=> "Lorang"
```
+Authentication is done through query parameters by default. If you want to use headers instead:
+```ruby
+ # This could go in an initializer
+ FullContact.configure do |config|
+ config.api_key = 'fullcontact_api_key_goes_here'
+ config.auth_type = :headers # :header or :query
+ end
+```
+
There's other ways you can query the Person API:
```ruby
# Get information about an email address, organized by hashes vs. lists
person2 = FullContact.person(email: 'bart@fullcontact.com', style: 'dictionary')
-
+
# You can pass in any arbitrary parameters the Person API supports
person3 = FullContact.person(email: 'bart@fullcontact.com', style: 'dictionary', webhookUrl: 'https://...')
-
+
# Get information about a twitter handle
person4 = FullContact.person(twitter: "bartlorang")
-
+
# Get information from a phone number
person6 = FullContact.person(phone:13037170414)
-
+
# Get information about a twitter and ensure a 30s socket open timeout and a 15s socket read timeout
# Can throw a Faraday::Error::TimeoutError if timeouts are exceeded
person7 = FullContact.person({:twitter => "bartlorang"}, {:request => {:timeout => 15, :open_timeout => 30}})
```
@@ -92,11 +101,11 @@
config.skip_rubyize = true
end
person8 = FullContact.person(email: "bart@fullcontact.com")
- => #<Hashie::Mash contactInfo=#<Hashie::Mash chats=[#<Hashie::Mash client="gtalk" handle="lorangb@gmail.com">,
+ => #<Hashie::Mash contactInfo=#<Hashie::Mash chats=[#<Hashie::Mash client="gtalk" handle="lorangb@gmail.com">,
#<Hashie::Mash client="skype" handle="bart.lorang">] familyName="Lorang" fullName="Bart Lorang" givenName="Bart...
```
You can also query the Company API
```ruby
@@ -105,10 +114,10 @@
company1.organization.name
=> "FullContact Inc."
```
-
+
Contributions
-------------
A full list of contributors can be found in
[GitHub](https://github.com/fullcontact/fullcontact-api-ruby/graphs/contributors)