Frequently Asked Question
Convert - Convert files between various formats
Last Updated 2 months ago
FileConvert API
Overview
This API allows you to convert files between different formats using the unoconv utility. It supports various conversions including spreadsheets, documents, and presentations.
Endpoint
/v2/fileconvert
Method
POST only
Authentication
API key required in the request header:
X-API-Key: your_api_key
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
File | File | Yes | The file to be converted |
f | String | Yes | Conversion function (e.g., XLSX2PDF) |
Supported Conversion Functions
ODS2XLSX
- Convert OpenDocument Spreadsheet to ExcelODS2CSV
- Convert OpenDocument Spreadsheet to CSVCSV2ODS
- Convert CSV to OpenDocument SpreadsheetCSV2XLSX
- Convert CSV to ExcelXLSX2ODS
- Convert Excel to OpenDocument SpreadsheetXLSX2CSV
- Convert Excel to CSVDOC2PDF
- Convert Word Document to PDFDOCX2PDF
- Convert Word Document to PDFXLS2PDF
- Convert Excel to PDFXLSX2PDF
- Convert Excel to PDFPPT2PDF
- Convert PowerPoint to PDFPPTX2PDF
- Convert PowerPoint to PDF
Response
On success, the API returns the converted file with appropriate Content-Type and Content-Disposition headers for download.
On failure, the API returns a JSON response with error details:
{ "status": "error", "message": "Error message description", "details": "Additional error details (if available)" }
Example Usage
Using cURL
curl -X POST \ -H "X-API-Key: your_api_key" \ -F "File=@/path/to/your/document.xlsx" \ -F "f=XLSX2PDF" \ "https://api-url/v2/fileconvert" \ --output converted_document.pdf
Using HTML Form with JavaScript
Convert
Error Codes
Error | Description |
---|---|
No file uploaded or upload error | The file was not properly uploaded or there was an error during upload |
Invalid conversion function | The specified conversion function is not supported |
File conversion failed | The conversion process failed, check the details field for more information |
unauthorised | Invalid or missing API key |
insufficient credit | Your account does not have sufficient credit to perform this operation |