This is the HolySheet web API documentation. This is used by the webapp but can be forked and used by others.
The following are headers (OR URL queries if specified) all requests should have:
Name | Example | Description |
---|---|---|
Authorization | ya29.TcB0P5v6uuH7oiDjc8yLteZdB6yzXgw9WeAZPKgn8Dbubu1q1XvBZ6L4m_nVvdSc0mf6LVqLBW-SkAD0WquaUMmi14AWGQF1Uz6TYcScoSZcNQDZew_TYZNRLMqU15-qPyQ | The access token given by Google for the client |
Lists HolySheet generated files.
Request
Property | Description |
---|---|
path |
(optional) The path to list files from relative from the sheetStore folder |
starred |
(optional) Boolean value to only list starred files. Defaults to false |
trashed |
(optional) Boolean value to only list trashed files. Defaults to false |
Response
Property | Description |
---|---|
name |
The name of the file |
id |
The drive ID of the containing folder of the sheets |
path |
The path of the file in HolySheet |
sheets |
The number of sheets making up the file |
size |
The size in bytes of all encoded data uploaded to sheets |
date |
The date in milliseconds the file was created |
selfOwned |
If the file is owned by the user or shared |
owner |
The file owner's name |
driveLink |
A direct Google Drive link to the top-level folder containing the sheets |
starred |
If the file is starred |
trashed |
If the file is currently in the trash |
$ curl https://api.holysheet.net/list?path=subdir&starred=false&trashed=false -H 'Authentication: xyz'
[
{
"name": "bob.mp4",
"id": "16dHIeHW82BYgBgfMlp3SQ8D1rhRmRO0F",
"path": "/",
"sheets": 6,
"size": "59663369",
"date": "1580423863739",
"selfOwned": true,
"owner": "Adam Yarris",
"driveLink": "https://drive.google.com/drive/folders/16dHIeHW82BYgBgfMlp3SQ8D1rhRmRO0F",
"starred": true,
"trashed": false
}
]
Uploads an arbitrary file to HolySheet.
Request
Property | Description |
---|---|
Authentication |
The authentication token, instead of as a header |
name |
The name of the file being uploaded |
length |
The length in bytes of the file being uploaded |
path |
The path to list files from relative from the sheetStore folder |
Response
Property | Description |
---|---|
status |
The status of the previous chunk upload. Standard responses will be "ok" |
progress |
The 0-100 percentage of completion |
Whenever a status
of "ok"
is sent to the server, raw binary data of the file being uploaded must be sent. The upload will not succeed if data is sent otherwise. The most data sent per chunk is 4MB. Anything more will close with a 1009.
Response Codes
These are close reason codes. The standard response on the right will be the reason for the close.
Property | Description |
---|---|
1000 | A successful file upload, happens when the uploaded length meets the length given in the request. Status will always be "done" |
1009 | The sent data is too large (Over 4MB) |
1011 | An internal server error has occurred. Site administrators should look in the server logs for any stacktraces. The upload of the file is not guaranteed, it should be expected to have failed. |
$ curl -F 'data=@/home/RubbaBoy/input.png' https://api.holysheet.org/upload?Authentication=xyz&name=input.png&length=123456&path=/
{
"status": "ok",
"progress": 82
}
{
"status": "done",
"progress": 100
}
{
"status": "Maximum payload size is 4000000 bytes",
"progress": 0
}
{
"status": "An internal error occurred",
"progress": 0
}
Downloads a given file by its ID.
Request
Property | Description |
---|---|
Authentication |
The authentication token, instead of as a header |
id |
The drive ID of the file to download |
Response
Property | Description |
---|---|
N/A |
The raw byte stream of the file will be sent over as a response |
Timeout on this request must be high, as it may take some time to process the file.
$ curl https://api.holysheet.net/download?Authentication=xyz&id=abc -o file.png
Byte stream
Sends a given file ID into the standard Google Drive trash. If it is already trashed or the permanent
query is true
, it will be permanently deleted.
Request
Property | Description |
---|---|
id |
The drive ID of the file to delete |
permanent |
(optional) If the deletion should skip the trash phase |
Response
Property | Description |
---|---|
message |
The response message |
$ curl https://api.holysheet.net/delete?id=abc&permanent=false -H 'Authentication: xyz'
{
"message": "Deleted successfully"
}
Restores a trashed file with the given drive ID.
Request
Property | Description |
---|---|
id |
The drive ID of the file to restore |
Response
Property | Description |
---|---|
message |
The response message |
$ curl https://api.holysheet.net/restore?id=abc -H 'Authentication: xyz'
{
"message": "Restored successfully"
}
Stars (or unstars) a given file.
Request
Property | Description |
---|---|
id |
The drive ID of the file to restore |
starred |
A boolean value representing if a file should be starred (true) or unstarred (false). |
Response
Property | Description |
---|---|
message |
The response message |
$ curl https://api.holysheet.net/star?id=abc&starred=true -H 'Authentication: xyz'
{
"message": "Starred successfully"
}
Moves a given file to a path. This does not move the file in Google Drive, it adds a property saying where the file is, requiring all file moving in HolySheet to be done through the API.
Request
Property | Description |
---|---|
id |
The drive ID of the file to restore |
path |
The path to move the file to relative from the sheetStore folder |
Response
Property | Description |
---|---|
message |
The response message |
$ curl https://api.holysheet.net/move?id=abc&path=/test/ -H 'Authentication: xyz'
{
"message": "Moved successfully"
}
Creates an empty folder. These folders are not actual folders in Google Drive, they are simply some JSON data in the root sheetStore
folder.
Request
Property | Description |
---|---|
path |
The path relative from the sheetStore folder to create |
Response
Property | Description |
---|---|
message |
The response message |
$ curl https://api.holysheet.net/createfolder?path=/test/ -H 'Authentication: xyz'
{
"message": "Created successfully"
}