cURL
curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
--header "Authorization: Bearer <token>"import os
from writerai import Writer
client = Writer(
# This is the default and can be omitted
api_key=os.environ.get("WRITER_API_KEY"),
)
response = client.files.download(
"file_id",
)
print(response)
content = response.read()
print(content)import Writer from 'writer-sdk';
const client = new Writer({
apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.files.download('file_id');
console.log(response);
const content = await response.blob();
console.log(content);
}
main();"File contents"Files API
Download file
Download the binary content of a file. The response will contain the file data in the appropriate MIME type.
GET
/
v1
/
files
/
{file_id}
/
download
cURL
curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
--header "Authorization: Bearer <token>"import os
from writerai import Writer
client = Writer(
# This is the default and can be omitted
api_key=os.environ.get("WRITER_API_KEY"),
)
response = client.files.download(
"file_id",
)
print(response)
content = response.read()
print(content)import Writer from 'writer-sdk';
const client = new Writer({
apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.files.download('file_id');
console.log(response);
const content = await response.blob();
console.log(content);
}
main();"File contents"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.
Path Parameters
The unique identifier of the file.
Response
200 - application/octet-stream
File download successful
The response is of type file.
Was this page helpful?