The Headless API allows you to import CSVs and spreadsheet files via an API
Create a New Headless Import
Upload the File
"upload"
field) where you can upload the file. Store the ID for later use (you need it to fetch the import status and results).To upload the file, make a PUT request to the URL, with the file as the body. Note that the upload URL is only valid for 30 minutes, so only create the import record when you are ready to upload the file.Here is an example request for uploading the file:Wait for the Import to Run
Create a New Headless Import
Wait for the Import to Run
AWAITING_UPLOAD
: The import record has been created, but the import file has not yet been uploaded.PENDING
: The import file has been received, and the import process will begin shortly.RUNNING
: The import process is currently running.SUCCESSFUL
: The import was successful and the result data is ready to be retrieved.NEEDS_REVIEW
: The import could not be completed due to data validation errors, and requires human attention.FAILED
: The import encountered a fatal error, and cannot be processed.SUCCESSFUL
state.
You can be notified when an import completes in two ways:
SUCCESSFUL
, you can then retrieve the presigned URL using the headless import URL endpoint:
NEEDS_REVIEW
state.
This can happen for several reasons:
BLOCK_SUBMIT
NEEDS_REVIEW
state, the data returned by the retrieve headless import endpoint will include a "review_url"
field. This is a URL which you can navigate to in a browser to resolve the import issues using Dromo’s import UI.
After resolving the issues and completing the import, the import will transition to the SUCCESSFUL
state.
FAILED
state if it has an unrecoverable error.
Some examples of unrecoverable errors are: