Rclone and Gdrive custom API: error 401

What is the problem you are having with rclone?

I cannot communicate with Google remotes after having set up a custom API key.
I did everything as explained in Rclone guide to set up remote API key (added GDrive API, an Oauth consent screen, set up Oauth key as "Other" and copy pasted the credentials from Notepad). I also deleted the remote and recreated it, I also tried to edit it and refresh the token, but the error still appeared and I could not upload anything.
In Google Console library, the Drive API is clearly marked "Enabled".

What is your rclone version (output from rclone version)

latest build from master (rclone v1.48.0-074-g8e8b78d7-beta)

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10 64 bits

Which cloud storage system are you using? (eg Google Drive)

Google Photos

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy .\Photos\ gphoto:upload

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

2019/07/24 11:33:44 INFO : Starting HTTP transaction limiter: max 10 transactions/s with burst 1
2019/07/24 11:33:45 INFO : Google Photos path "upload": Waiting for checks to finish
2019/07/24 11:33:45 INFO : Google Photos path "upload": Waiting for transfers to finish
2019/07/24 11:33:46 ERROR : takeout2_input/Takeout/Google Photos/2018-09-24/20180924_181129.webp: Failed to copy: couldn't upload file: {
"code": 16,
"message": "The client has not activated the API."
} (401 401 Unauthorized)
2019/07/24 11:33:46 ERROR : takeout2_input/Takeout/Google Photos/2018-09-24/20180924_181104.webp: Failed to copy: couldn't upload file: {
"code": 16,
"message": "The client has not activated the API."
} (401 401 Unauthorized)

Extract from rclone.conf

[gphoto]
type = google photos
client_id = 193635xxxx-xxxxx.apps.googleusercontent.com
client_secret = XXXXXXXX
token = {"access_token":"ya29.XXXXXXXXXXXXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"2019-07-24T12:32:03.7039711+02:00"}

This looks like you are using the google photos backend rather than the google drive backend?

Thank you very much for your quick answer, activating Google Photos API did indeed fix the issue :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.