import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const fileListResponse of client.beta.files.list()) {
console.log(fileListResponse.id);
}{
"items": [
{
"id": "<string>",
"size": 123,
"md5_checksum": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "file",
"tags": {},
"duration_seconds": 123
}
],
"total": 123,
"has_more": true,
"object": "list",
"limit": 100
}import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const fileListResponse of client.beta.files.list()) {
console.log(fileListResponse.id);
}{
"items": [
{
"id": "<string>",
"size": 123,
"md5_checksum": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "file",
"tags": {},
"duration_seconds": 123
}
],
"total": 123,
"has_more": true,
"object": "list",
"limit": 100
}Filter files by filename (case-insensitive partial match)
1 <= x <= 1000asc, desc Successful Response
Show child attributes
"file"The total of items that match the query. This is greater than or equal to the number of items returned.
Whether there are more items left to be fetched.
"list"The maximum number of items to return.