Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8408115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:33:08+00:00 2026-06-09T23:33:08+00:00

In my Rails 3 app, I am able to successfully authenticate using Oauth2 and

  • 0

In my Rails 3 app, I am able to successfully authenticate using Oauth2 and able to get the metadata for a file. The downloadUrl is

https://doc-10-3o-docs.googleusercontent.com/docs/securesc/tj647mo7q16s2rquitcrcv800pkn7gcf/ap67p147th03cn8rjpu68i8qva3p7i8j/1345240800000/02289284805103305740/02289284805103305740/0BwsQ03A3DXbCTVBjUDlNNzNJNDQ?h=16653014193614665626&e=download&gd=true

The documentation states that I must do the following:

Gets a file’s metadata by ID. To download a file’s content, send an authorized HTTP GET request to the file’s downloadUrl

I do not wish to use Google APIs Client Library for Ruby, but simply formulate a HTTP Request using HTTParty

Here is a snippet of the code I’ve been trying to get to work

response = HTTParty.get(https://doc-10-3o-docs.googleusercontent.com/docs/securesc/tj647mo7q16s2rquitcrcv800pkn7gcf/ap67p147th03cn8rjpu68i8qva3p7i8j/1345240800000/02289284805103305740/0?access_token={token})
open("/User/mymachine/test.pdf", 'wb'){|pdf| pdf << response.body}

I’m pretty sure I’m formulating the request wrong. Any help would be greatly appreciated. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:33:09+00:00Added an answer on June 9, 2026 at 11:33 pm

    You have to add the Authorization: Bearer header to your request, together with the access token you retrieved during the OAuth 2.0 flow.

    Basically, your HTTP request must look like the one in the OAuth 2.0 documentation:

    https://developers.google.com/accounts/docs/OAuth2WebServer#callinganapi

    I’m not a Ruby expert, but the request using HTTParty should be:

    response = HTTParty.get(downloadUrl, :headers => {"Authorization" => "OAuth {token}"})
    

    Where downloadUrl is the one you got from the file’s metadata and token is the access token you retrieved when performing authorization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Devise gem in my Rails app for authentication. I could able
I'm using Devise in a Rails 3 app, and I successfully configured it so
In my Rails app I want users to be able to input video links
My rails app is set up using a mysql database. When I do a
My rails app allows users to edit a certain json file through the browser.
I have a rails app running on Heroku. I am using paperclip for some
In my Rails app, I am used to using syntax like the following in
I'd like Users in my Rails app to be able to share a link
I have a rails app that requires multi-table inheritance for which I am using
I am making a Ruby on Rails app and I need to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.