The Shadow Book
Search
⌃K

The API

Shadow Drive exposes an API that you can interact directly without the need of the CLI or SDK. You may build on top of these methods.

Shadow Drive API

👉Mainnet-Beta API Base URL: https://shadow-storage.genesysgo.net
POST /storage-account - Creates a new storage account
Request content type: application/json
Parameters:
  1. 1.
    transaction: Serialized create storage account transaction that's partially signed by the storage account owner
Response:
{
"shdw_bucket": String,
"transaction_signature": String
}
POST /storage-account-info - Gets on-chain and Shadow Drive Network data about a storage account
Request content type: application/json
Parameters:
  1. 1.
    storage_account: Publickey of the storage account you want to get information for
Response for V1 Storage Account:
{
storage_account: PublicKey,
reserved_bytes: Number,
current_usage: Number,
immutable: Boolean,
to_be_deleted: Boolean,
delete_request_epoch: Number,
owner1: PublicKey,
owner2: PublicKey,
accountCoutnerSeed: Number,
creation_time: Number,
creation_epoch: Number,
last_fee_epoch: Number,
identifier: String
version: "V1"
}
Response for V2 Storage Account
{
storage_account: PublicKey,
reserved_bytes: Number,
current_usage: Number,
immutable: Boolean,
to_be_deleted: Boolean,
delete_request_epoch: Number,
owner1: PublicKey,
accountCoutnerSeed: Number,
creation_time: Number,
creation_epoch: Number,
last_fee_epoch: Number,
identifier: String,
version: "V2"
}
POST /upload - Uploads a single file or multiple files at once
Request content type: multipart/form-data
Parameters (FormData fields):
  1. 1.
    file: The file you want to upload. You may add up to 5 files each with a field name of file.
  2. 2.
    message: Base58 message signature.
  3. 3.
    signer: Publickey of the signer of the message signature and owner of the storage account
  4. 4.
    storage_account: Key of the storage account you want to upload to
Response:
{
"finalized_locations": [String],
"message": String
"upload_errors": [{file: String, storage_account: String, error: String}] or [] if no errors
}
POST /edit - Edits an existing file
Request content type: multipart/form-data
Parameters (FormData fields):
  1. 1.
    file: The file you want to upload. You may add up to 5 files each with a field name of file.
  2. 2.
    message: Base58 message signature.
  3. 3.
    signer: Publickey of the signer of the message signature and owner of the storage account
  4. 4.
    storage_account: Key of the storage account you want to upload to
  5. 5.
    url: Url of the original file you want to edit. Example: `https://shdw-drive.genesysgo.net/<storage-account>/<file-name>`
Response:
{
"finalized_location": String,
"error": String or not provided if no error
}
POST /list-objects - Get a list of all files associated with a storage account
Request content type: application/json
Parameters:
  1. 1.
    storageAccount: String version of the storage account PublicKey that you want to get a list of files for
Response:
{
"keys": [String]
}
POST /list-objects-and-sizes - Get a list of all files and their size associated with a storage account
Parameters:
  1. 1.
    storageAccount: String version of the storage account PublicKey that you want to get a list of files for
Response:
{
"files": [{"file_name": String, size: Number}]
}
POST /get-object-data - Get information about an object
Request content type: application/json
Parameters:
  1. 1.
    location: URL of the file you want to get information for
Response: JSON object of the file's metadata in the Shadow Drive Network or an error
POST /delete-file - Deletes a file from a given Storage Account
Request content type: application/json
Parameters:
  1. 1.
    message: Base58 message signature.
  2. 2.
    signer: Publickey of the signer of the message signature and owner of the storage account
  3. 3.
    location: URL of the file you want to delete
Response:
{
"message": String,
"error": String or not passed if no error
}
POST /add-storage
Request content type: application/json
Parameters:
  1. 1.
    transaction - Serialized add storage transaction that is partially signed by the shadow drive network
Response:
{
message: String,
transaction_signature: String,
error: String or not provided if no error
}
POST /reduce-storage
Request content type: application/json
Parameters:
  1. 1.
    transaction - Serialized reduce storage transaction that is partially signed by the shadow drive network
Response:
{
message: String,
transaction_signature: String,
error: String or not provided if no error
}
POST /make-immutable
Request content type: application/json
Parameters:
  1. 1.
    transaction - Serialized make immutable transaction that is partially signed by the shadow drive network
Response:
{
message: String,
transaction_signature: String,
error: String or not provided if no error
}
Last modified 5mo ago