Skip to main content
GET
/
boxes
/
{boxId}
/
media
/
albums
/
{albumName}
/
media
/
{mediaName}
/
download
JavaScript
import GboxSDK from "gbox-sdk";
import fs from "fs";

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});

async function main() {
  const box = await gboxSDK.create({ type: "android" });

  console.info("taking screenshot and saving to album...");

  await box.action.screenshot({
    saveToAlbum: true
  })

  const album = await box.media.getAlbum("Screenshots");

  console.info("listing media info...");

  const mediaInfo = await album.listMediaInfo();

  console.info(`media info: ${JSON.stringify(mediaInfo, null, 2)}`);

  const media = await album.listMedia();

  console.info("downloading media...");
	
  for (const item of media) {
    await item.download(`./${item.data.name}`);
  }

}

main();
import os
from gbox_sdk import GboxSDK

def main():
# Initialize GboxSDK with API key from environment variable
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])

# Create an Android box for media operations
box = gbox_sdk.create(type="android")

print("taking screenshot and saving to album...")

# Take screenshot and save to album
box.action.screenshot(save_to_album=True)

# Get the Screenshots album
album = box.media.get_album("Screenshots")

print("listing media info...")

# Get media information
media_info = album.list_media_info()
print(f"media info: {media_info}")

# Get media list
media = album.list_media()

print("downloading media...")

# Download each media file
for item in media:
item.download(f"./{item.data.name}")

if __name__ == "__main__":
main()
curl --request GET \
--url https://gbox.ai/api/v1/boxes/{boxId}/media/albums/{albumName}/media/{mediaName}/download \
--header 'Authorization: Bearer <token>'
"<string>"

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer . Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

albumName
string
required

Album name

Example:

"Pictures"

mediaName
string
required

Media name

Example:

"IMG_001.jpg"

Response

200 - application/octet-stream

Media file content

The response is of type file.