Skip to content

Instantly share code, notes, and snippets.

@nax3t
Last active August 29, 2015 14:18
Show Gist options
  • Save nax3t/09d4a11452f3825d526d to your computer and use it in GitHub Desktop.
Save nax3t/09d4a11452f3825d526d to your computer and use it in GitHub Desktop.
Solution for Mike's API request
# My solution, using Typhoeus gem
p "-------Ian\'s Solution---------"
require 'typhoeus'
request = Typhoeus::Request.new("https://api.admoda.com/v1/advertiser/stats/campaigns.csv?date=2015-03-11",
method: :get,
headers: { 'Authorization' => 'Token api_token_here' })
response = request.run
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment