Ruby on Rails
Monday, November 23, 2015
Hi Fred,
Thanks for your reply.
Actually i got the API result form chrome postman.(https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en)
Here i gave the URL like https://pipeline-api.locallabs.com/api/v1/organizations?min_updated_at='2015-11-13&limit=10' and i set the authorization key in header an got the Exact result.
But i don't know how to access this url in Rails. If i give this URL in browser then return unauthorized result.
Please suggest me.
Thanks!
On Wed, Nov 18, 2015 at 3:32 PM, Frederick Cheung <frederick.cheung@gmail.com> wrote:
On Tuesday, November 17, 2015 at 3:14:33 PM UTC, daynthan kabilan wrote:Hi,I need to call API using curl in seed.rbBefore i have used API likeresponse = HTTParty.get("https://pipeline.locallabs.com/api/v1/organizations?access_key=XXXXXX")i don't know how to call API using curl in ssed.rbnow my client assign one new domain and mentioned this was working for him.curl -H'Authorization: KEY' https://pipeline-api.locallabs.com/api/v1/organizations?min_updated_at='2015-11-13&limit=10'Any one know how to call API using curl in seed.rb please let me know.Why use curl instead of a ruby method (e.g. HTTPary since you are already used to that) ? You can shell out with system, popen etc but that seems like an inferior solution unless there is some other constraint you haven't mentioned. You can pass headers by doing something like HTTPParty.get("http://...", headers: {foo: 'bar'})Fred--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a0d4cd33-56ef-4fb0-abbe-3a765918f3e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyQvTBR9ghGZ368fW0G0_wkke7s0HLZEbsGYGiLvLB%2Baeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment