JavaScript
import GboxSDK from "gbox-sdk";
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("deleting all media in album...");
for (const media of await album.listMedia()) {
await album.deleteMedia(media.data.name);
console.info(`deleted ${media.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("deleting all media in album...")
# Delete all media in the album
for media in album.list_media():
album.delete_media(media.data.name)
print(f"deleted {media.data.name}")
if __name__ == "__main__":
main()curl --request DELETE \
--url https://gbox.ai/api/v1/boxes/{boxId}/media/albums/{albumName}/media/{mediaName} \
--header 'Authorization: Bearer <token>'Media
Delete media from album
Delete a specific media file from an album
DELETE
/
boxes
/
{boxId}
/
media
/
albums
/
{albumName}
/
media
/
{mediaName}
JavaScript
import GboxSDK from "gbox-sdk";
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("deleting all media in album...");
for (const media of await album.listMedia()) {
await album.deleteMedia(media.data.name);
console.info(`deleted ${media.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("deleting all media in album...")
# Delete all media in the album
for media in album.list_media():
album.delete_media(media.data.name)
print(f"deleted {media.data.name}")
if __name__ == "__main__":
main()curl --request DELETE \
--url https://gbox.ai/api/v1/boxes/{boxId}/media/albums/{albumName}/media/{mediaName} \
--header 'Authorization: Bearer <token>'Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Path Parameters
Box ID
Example:
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Album name
Example:
"Pictures"
Media name
Example:
"IMG_001.jpg"
Response
204
Media deleted successfully
Was this page helpful?
⌘I