Skip to content

Enables Ruby applications to communicate with the Magento REST API.

License

Notifications You must be signed in to change notification settings

PuujeU/magento_api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento REST API - Ruby Client

This library provides a wrapper around the Magento REST API for use within Ruby apps.

OAuth

The easiest way to obtain credentials is to use one of the Omniauth Ruby gems:

Configuring Magento

@michaelimstepf has included some detailed instructions with his gem.

Usage

#initialize
config = {
  consumer_key:       'YOUR_CONSUMER_KEY',
  consumer_secret:    'YOUR_CONSUMER_SECRET',
  site:               'HTTP://WWW.YOURSITE.COM', #omit the trailing slash
  oauth_token:        'YOUR_OAUTH_TOKEN',
  oauth_token_secret: 'YOUR_TOKEN_SECRET',
}

api = Magento::Api.new(config)

#resource collection
products = api.get('products', {page: 2})

#single resource
product = api.get('products/4')

#update
api.put('products/4', {description:"even cooler than before"})

#delete
api.delete('products/4')

#child resource collection
api.get('products/4/images')

#update child resource
api.put('products/4/images/2', {...})

Testing

Set ENV['HTTP_DEBUG'] = 'true' to get a better idea of what's happening uner the hood.

About

Enables Ruby applications to communicate with the Magento REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%