import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const file of client.beta.files.list()) {
console.log(file.id);
}
{
"object": "list",
"items": [
{
"id": "<string>",
"object": "file",
"size": 123,
"md5_checksum": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"object": "identity",
"type": "user"
}
}
],
"limit": 100,
"total": 123,
"has_more": true
}
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const file of client.beta.files.list()) {
console.log(file.id);
}
{
"object": "list",
"items": [
{
"id": "<string>",
"object": "file",
"size": 123,
"md5_checksum": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"object": "identity",
"type": "user"
}
}
],
"limit": 100,
"total": 123,
"has_more": true
}
1 <= x <= 1000
asc
, desc
Successful Response
The response is of type object
.