Created
June 18, 2018 12:02
-
-
Save amitpatelx/cb74b10779dfe8f205c0066c2c4628af to your computer and use it in GitHub Desktop.
Access google drive API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'google/apis/drive_v3' | |
require "googleauth" | |
credentials = | |
Google::Auth::UserRefreshCredentials.new( | |
client_id: "854280762506-lrrj2ajqh9b.apps.googleusercontent.com", | |
client_secret: "jWiGrijiFCNRmig1s3aQt", | |
scope: ["https://www.googleapis.com/auth/drive"], | |
additional_parameters: { "access_type" => "offline" }) | |
credentials.refresh_token = '1/clpHfRpyVonjRpYFyfstY3zD9TSX6MgcX2C1lJ-RTEQ' | |
credentials.fetch_access_token! | |
service = Google::Apis::DriveV3.new | |
service.authorization = credentials |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment