import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const file = await client.files.retrieve('file_xxxxxxxxxxxxx');
console.log(file.id);{
"id": "file_xxxxxxxxxxxxx",
"upload_status": "pending",
"filename": "document.pdf",
"content_type": "image/jpeg",
"size": "123.45",
"url": "https://media.whop.com/abc123/document.pdf"
}Retrieves the details of an existing file.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const file = await client.files.retrieve('file_xxxxxxxxxxxxx');
console.log(file.id);{
"id": "file_xxxxxxxxxxxxx",
"upload_status": "pending",
"filename": "document.pdf",
"content_type": "image/jpeg",
"size": "123.45",
"url": "https://media.whop.com/abc123/document.pdf"
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
The unique identifier of the file to retrieve.
"file_xxxxxxxxxxxxx"
A successful response
A file that has been uploaded or is pending upload.
The unique identifier for the file.
"file_xxxxxxxxxxxxx"
The current upload status of the file (e.g., pending, ready).
pending, processing, ready, failed The original filename of the uploaded file, including its file extension.
"document.pdf"
The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).
"image/jpeg"
The file size in bytes. Null if the file has not finished uploading.
"123.45"
The CDN URL for accessing the file. Null if the file has not finished uploading.
"https://media.whop.com/abc123/document.pdf"
Was this page helpful?