# (NEW) Retrieve old revision file from Google Drive

This method was updated at July 12, 2017.

### 1. File ID

Retrieve file id from file name.

curl -X GET -sSL \


### 2. Revision ID

Retrieve revision id from file id.

curl -X GET -sSL \


### 3. File for Revision ID

Retrieve a file from revision id.

For Google Docs (spreadsheet, document, slide and drawing), since recently I noticed that the revision files would not be able to be retrieved using Drive API v3, I modified this using new workaround.

**New workaround : ** The new workaround is to use Drive API v2. drive.revisions.get of Drive API v2 can retrieve not only the revision list, but also the export links. I thought of the use of the export links. This became the new workaround.

curl -sSLG \

curl -sSLG \
-o outputfilename.xlsx


I don’t know when this workaround will not be able to be used. But if this could not be used, I would like to investigate of other method.

In the case of except for Google Docs, the revision ID is just file ID. So you can download not only using revision ID, but also as a normal file.

##### Pattern 1
curl -sSLG \
"https://www.googleapis.com/drive/v3/files/### FileID ###/revisions/### RevisionID ###?alt=media" \
-o outputfilename

##### Pattern 2
curl -sSLG \
-o outputfilename


### For GAS

At current stage, the revisions of project (GAS) cannot be retrieved yet. Because there are a revision history for each project at the script editor, there are possibly some methods for retrieving them using APIs. But I don’t know yet. I’m sorry.

When the revision list of GAS is retrieved, following error occurs.

{
"error": {
"errors": [
{
"domain": "global",
"reason": "revisionsNotSupported",
"message": "The file does not support revisions."
}
],
"code": 403,
"message": "The file does not support revisions."
}
}