Skip to main content

Get a link to upload a file

POST https://api.rollstack.com/public/v1/datasets/uploads

Answers a link to send a CSV file or an Excel workbook (.xlsx) to from a shell, as it is on disk, at most 10 MB: use it when the user gives you a file, in place of writing a CSV into createDataset, and for every workbook. Run the command it answers with the path of the file. The upload answers the uploaded file with its id, as createDataset does: add it to a report with addReportDatasheets, a workbook after reading its sheets with getDataset. With datasetId, the file replaces the content of that uploaded file. The link works for 10 minutes and for one file: a file that is refused uses it up, so ask for another. Without a shell, write the CSV into createDataset. At most 20 links a minute per user.

Requires the slide_decks:write scope.

Operation ID: createDatasetUpload.

Headers

  • Idempotency-Key (string): A unique value, such as a UUID, that makes retrying this call safe. A retry with the same key within 24 hours answers the first call's result instead of running it again. Use a new key for each new call. From 1 to 255 printable ASCII characters.

Request body, required

application/json

  • datasetId (string): An uploaded file to replace the content of: its id from createDataset, or a datasheet's datasetId in listReportDatasheets. The file sent must be of its kind, a CSV for a CSV and a workbook for a workbook, and it keeps its id and name. Only the user who uploaded it may. Omit it to upload a new file.

Response 201

Success

application/json

  • uploadUrl (string, required): Where to send the file, as multipart/form-data in the file field, with no API key: the link is the permission, for one file. It answers the uploaded file as createDataset does, with its id.
  • command (string, required): A curl command that sends the file: replace PATH_TO_FILE with the file's path and run it in a shell. The file's name must end in .csv or .xlsx.
  • expiresAt (string (date-time), required): When the link stops working, 10 minutes after it was made.