The OfficeAutopilot Ruby Gem
A Ruby wrapper for the OfficeAutopilot API
Installation
gem install office_autopilot
Usage Examples
require "rubygems"
require "office_autopilot"
client = OfficeAutopilot::Client.new(:api_id => 'xxx', :api_key => 'yyy')
# Search Contacts
puts client.contacts_search(:field => 'E-Mail', :op => 'e', :value => '[email protected]')
# results truncated for brevity but ALL fields (including custom fields) are returned
=> [{"id"=>"7",
"Contact Information"=>{"First Name"=>"testing", "Last Name"=>"testing", "E-Mail"=>"[email protected]"},
"Lead Information"=>{"Contact Owner"=>"XXX", "First Referrer"=>"", "Last Referrer"=>""},
"Sequences and Tags"=>{"Sequences"=>"*/*", "Contact Tags"=>""},
"Purchase History"=>{}
}]
# Add Contact
puts client.contacts_add({ 'Contact Information' => {'First Name' => 'Turtle', 'Last Name' => 'Jones', 'E-Mail' => '[email protected]'} })
# results truncated for brevity
=> {"id"=>"24", "Contact Information"=>{"First Name"=>"Turtle", "Last Name"=>"Jones", "E-Mail"=>"[email protected]"}}
Documentation
Todo
- support ALL API calls
Submitting a Pull Request
- Fork the project.
- Create a topic branch.
- Implement your feature or bug fix.
- Add documentation for your feature or bug fix.
- Add specs for your feature or bug fix.
- Run bundle exec rake spec. If your changes are not 100% covered, go back to step 5.
- Commit and push your changes.
- Submit a pull request. Please do not include changes to the gemspec or version file. (If you want to create your own version for some reason, please do so in a separate commit.)
Copyright
Copyright (c) 2011 Prashant Nadarajan. See LICENSE for details.