Uploading Documents via the API

While there is a range of different types of API endpoints that drive the Affinda solution, uploading documents for processing (and receiving the response) is core to the product. Without documents, there is no Intelligent Document Processing!

Request Body

The following parameters may be included in the API POST request to Affinda using the Upload a document for parsing endpoint.

Note, all individual parameters are optional, however, one (and only one) of the following must be specified:

  • File or URL
  • Workspace or Collection
ParameterDescription
fileFile as binary data blob. Supported formats: PDF, ZIP, DOC, DOCX,XLS, XLSX, ODT, RTF, TXT, HTML, PNG, JPG, TIFF, JEPG
urlURL to a document to download and process
collectionUniquely identifier for the Collection to upload the document to
- The Collection identifier can be found by either using the Get list of all collections endpoint or through the app
- If Collection is specified, the document will not be classified to a different Collection if it is the wrong type (however it may be rejected depending on settings)
workspaceUniquely identifier for the Workspace to upload the document to
- The Workspace identifier can be found by either using the Get list of all workspaces endpoint or through the app
- If Workspace is specified, Affinda will attempt to classify the document into a relevant Collection based on document type
waitIf "true" (default), will return a response only after processing has been completed. If "false", will return an empty data object which can be polled at the GET endpoint until processing is complete.
identifierSpecify a custom identifier for the document.
fileNameThe optional filename of the file
expiryTimeThe date/time in ISO-8601 format when the document will be automatically deleted. Defaults to no expiry.
languageLanguage code in ISO 639-1 format. Must specify zh-cn or zh-tw for Chinese.