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" });
// List albums
const albums = await box.media.listAlbums();
console.log("Albums found:");
for (const album of albums) {
console.info(`📁 ${album.data.name} - ${album.data.path}`);
console.info(`Last modified: ${album.data.lastModified}`);
}
}
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")
# List all albums
albums = box.media.list_albums()
# Print album information
print("Albums found:")
for album in albums:
print(f"📁 {album.data.name} - {album.data.path}")
print(f"Last modified: {album.data.last_modified}")
if __name__ == "__main__":
main()curl --request GET \
--url https://gbox.ai/api/v1/boxes/{boxId}/media/albums \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "Vacation Photos",
"path": "/sdcard/albums/vacation",
"lastModified": "2021-01-01T00:00:00Z",
"mediaCount": 15
}
]
}Media
List albums
Get a list of albums in the box
GET
/
boxes
/
{boxId}
/
media
/
albums
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" });
// List albums
const albums = await box.media.listAlbums();
console.log("Albums found:");
for (const album of albums) {
console.info(`📁 ${album.data.name} - ${album.data.path}`);
console.info(`Last modified: ${album.data.lastModified}`);
}
}
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")
# List all albums
albums = box.media.list_albums()
# Print album information
print("Albums found:")
for album in albums:
print(f"📁 {album.data.name} - {album.data.path}")
print(f"Last modified: {album.data.last_modified}")
if __name__ == "__main__":
main()curl --request GET \
--url https://gbox.ai/api/v1/boxes/{boxId}/media/albums \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "Vacation Photos",
"path": "/sdcard/albums/vacation",
"lastModified": "2021-01-01T00:00:00Z",
"mediaCount": 15
}
]
}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"
Response
200 - application/json
List albums
List albums
List of albums
Show child attributes
Show child attributes
Was this page helpful?
⌘I