marketo-api-ruby

home

github.com/ClearFit/marketo-api-ruby

code

github.com/ClearFit/marketo-api-ruby

bugs

github.com/ClearFit/marketo-api-ruby/issues

rdoc

rdoc.info/gems/marketo-api-ruby

continuous integration

test coverage

Coverage Status

Description

MarketoAPI (marketo-api-ruby) provides a native Ruby interface to the Marketo SOAP API, using savon. While understanding the Marketo SOAP API is necessary for using marketo-api-ruby, it is an explicit goal that working with MarketoAPI not feel like working with a hinky Java port.

This is release 0.9.1, targeting Marketo API version 2.3, fixing a syncLead problem where Id, Email, and ForeignSysPersonId are inconsistent with other syncLead parameters. This fixes an issue with Marketo campaign methods.

Please note that Ruby 1.9.2 is not officially supported, but MarketoAPI will install on any version of Ruby 1.9.2 or later.

Features/Problems

The marketo-api-ruby implementation of the Marketo SOAP API is incomplete, but is scheduled to be complete against Marketo SOAP API 2.3 for the version 1.0 release; this will take some time.

Synopsis

require 'marketo_api' # Only required if not loaded by Bundler
marketo = MarketoAPI.client(
  api_subdomain:  '123-ABC-456',
  user_id:        'my-api-user-id',
  encryption_key: 'my-api-encryption-key'
)

# Get a lead by email, and sync it back to Marketo.
lead = marketo.leads.get_by_email('mork@ork.com')
lead.email = 'mindy@ork.com'
lead.sync!

# Get campaigns for marketo (MKTOWS)
puts marketo.campaigns.for_marketo

# Delete Opportunity 75.
marketo.mobjects.delete MarketoAPI::MObject.opportunity(75)

# Get all Marketo programs

Install

Add to your application's Gemfile:

gem 'marketo-api-ruby'

Or install manually:

gem install marketo-api-ruby

Developers

After checking out the source, run:

$ rake newb

This task will install any missing dependencies, run the tests/specs, and generate the RDoc.

marketo-api-ruby Modified Semantic Versioning

The marketo-api-ruby library tracks an externally versioned API; this is not fully compatible with all aspects of Semantic Versioning.

  1. MAJOR versions will be updated when targeting a new major version of the Marketo API, if Marketo makes incompatible changes to its API in minor versions, or when incompatible marketo-api-ruby API changes are made. The release notes will identify the cause of the update.

  2. MINOR versions will be updated when targeting a new minor version of the Marketo API (e.g., Marketo version 2.2 to 2.3).

  3. PATCH version when backwards-compatible bug fixes are made.

Additionally, each release will clearly identify which Marketo API it targets as its baseline. If a release is made without a PATCH level, it can be assumed to be zero.

In practical terms, MAJOR versions will only be updated if you cannot use an earlier API version for an existing query (such as +Marketo::Lead#sync+).

Contributing

I value any contribution to marketo-api-ruby you can provide: a bug report, a feature request, or code contributions. Here are a few guidelines:

Test Dependencies

marketo-api-ruby uses Ryan Davis’s Hoe to manage the release process, and it adds a number of rake tasks. You will mostly be interested in:

$ rake

which runs the tests the same way that:

$ rake test
$ rake travis

will do.

To assist with the installation of the development dependencies for marketo-api-ruby, I have provided the simplest possible Gemfile pointing to the (generated) marketo-api-ruby.gemspec file. This will permit you to do:

$ bundle install

to get the development dependencies. If you aleady have hoe installed, you can accomplish the same thing with:

$ rake newb

This task will install any missing dependencies, run the tests/specs, and generate the RDoc.

Workflow

Here's the most direct way to get your work merged into the project:

Contributors

Licence

This software is available under the terms of the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.