https://github.com/markbates/snooze_force
SnoozeForce - A Client for Saleforce.com's REST API
https://github.com/markbates/snooze_force
Last synced: 1 day ago
JSON representation
SnoozeForce - A Client for Saleforce.com's REST API
- Host: GitHub
- URL: https://github.com/markbates/snooze_force
- Owner: markbates
- License: mit
- Created: 2011-07-07T15:41:31.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-07-19T18:43:57.000Z (almost 14 years ago)
- Last Synced: 2025-02-07T14:39:28.171Z (5 months ago)
- Language: Ruby
- Homepage: http://www.metabates.com
- Size: 108 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h1. SnoozeForce - A Client for Saleforce.com's REST API
h2. Setup
client = SnoozeForce::Client.new(:instance_url => 'https://XXX.salesforce.com',
:token => '00D...cg3',
:uid => '005...IAC',
:refresh_token => "5Ae...JcQ==",
:client_id => '3MV...zYT',
:client_secret => '782...385')h2. Use
h3. Direct Access
res = client.get('sobjects/User/005...IAC')
puts res.inspecth3. Access Attributes
res = client.user.me # same as:
# client.get('sobjects/User/005...IAC')
# client.user.get('/005...IAC')
puts res['Username'] # => 'joesmith'h3. Object Access
res = client.news_feed.get # same as:
# client.news_feed.get('/')
puts res.inspect
res = client.user.me # same as:
# client.get('sobjects/User/005...IAC')
# client.user.get('/005...IAC')
res = client.account.get('/XXXX')
# etc....h3. SObject Details
puts client.account._sobject.inspect # returns the details of the sobjecth3. Describe
puts client.account._describeh3. Fields
puts client.account._fieldsh3. Query
res = client.query("SELECT Id, Name FROM Account")
puts res.inspecth3. Search
res = client.search("FIND+{Oil}")
puts res.inspecth3. Post
res = client.account.post('/', {:body => {'Name' => 'Billy Bob'}})
puts res.inspect