import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const applicationFiles = await client.applications.uploadFiles({
files: [fs.createReadStream('path/to/file')],
});
console.log(applicationFiles);
[
{
"id": "<string>",
"file_name": "<string>",
"file_size_bytes": 123,
"file_artifact_blob_path": "<string>",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const applicationFiles = await client.applications.uploadFiles({
files: [fs.createReadStream('path/to/file')],
});
console.log(applicationFiles);
[
{
"id": "<string>",
"file_name": "<string>",
"file_size_bytes": 123,
"file_artifact_blob_path": "<string>",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
Account which the file will be tied to. Use this account id query param if you are using the API or the SDK.
Successful Response
The response is of type ApplicationFileResponse · object[]
.