Supported file types
Markdown representations work with the following document formats:- Microsoft Office: Word (.docx), PowerPoint (.pptx), Excel (.xls, .xlsx, .xlsm)
- Google Workspace: Google Docs (.gdoc), Google Slides (.gslide, .gslides),
- Google Sheets (.gsheet)
- PDF files (.pdf)
Create a markdown representation
This process describes how to generate and download a Markdown representation of a file using the Box API. To first create a markdown representation:- Get the list of representations available for a file
- Request a markdown representation by passing the
x-rep-hints-header with the value[markdown]. - Download the markdown by calling the
url_template, replacing the{+asset_path}with an empty string.
Get available representations
Request the file’s available representations, specifying a Markdown representation hint.Response example
Trigger Markdown generation
If the state isnone, request the info URL to begin generating the Markdown representation.
Check representation status
Re-query the file to check the current status of the Markdown representation.pending to success, the Markdown file is ready to download. The status indicates if the representation is available. Available options are success, viewable, pending, or none. Success means you can immediately download the representation, while none indicates the representation can be generated.
Download the Markdown representation
Once the representation is ready, use thecontent/url_template to download it.
