Documents

Convert JSON to an Excel file

Turns an array of objects into a real .xlsx workbook, one sheet, columns taken from the union of every object's keys. Up to 100,000 rows and 1,000 columns (and 2 million cells, rows x columns). If the data contains content you do not control (form answers, emails, web pages), set escape_formulas to true: a value sent as an object such as {"formula":"1+1"} would otherwise be saved as a real formula, and text starting with = + - @ could be read as a formula in another program.

Costs 1 credit per call.

post/json-to-excel

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/json-to-excel
  • Auth: API key in header x-api-key

Request body

dataobject[] required

The rows for the spreadsheet: a non-empty array of objects (up to 100000), e.g. [{"name":"Ana","age":30}]. The columns are every key found in any object, in order of first appearance.

sheet_namestring

Name of the worksheet. Default "Sheet1". Up to 31 characters (longer names are cut); it cannot contain * ? : \ / [ ], start or end with an apostrophe, or be "History" (a name with any of those returns a 400 error).

headerboolean

true (default) = the first row holds the column names; false = data rows only.

escape_formulasboolean

true = keep the data from turning into formulas, links or error cells: a value sent as an object or list (for example {"formula":"1+1"} or {"text":"x","hyperlink":"https://example.com"}, which would otherwise be saved as a real formula or link) is written as its JSON text, and every text value (and every column name) that starts with =, +, -, @, a tab or a carriage return gets a single quote added in front ("=1+1" is written as "'=1+1"). JSON numbers and booleans are never changed. false = write the values exactly as received. Use true whenever the data includes content you do not control (form answers, emails, web pages); with it on you cannot send real formulas in data.

output'json' | 'xlsx' | 'binary' | 'url'

How to return the workbook: "json" (default: base64 in the JSON response), "xlsx" or "binary" (the .xlsx file itself as the response body; both do the same) or "url" (a temporary download link, valid 15 minutes).

Response

Result.

successboolean
xlsxstring byte

Changes

No recorded changes to this operation across all 1 revision of this API.