API REST – File Upload (1.0)

Download OpenAPI specification:Download

File upload API is a web service that allows single file uploads that later could be used as an attach file to an email message included in a smart conversation flow inside the Conversation Manager in DANAconnect platform.

This web service is commonly used to send a different file to each contact. For example: a statement of account, an invoice or a personalized letter.

Usually this service is used in conjunction and before triggering the Conversation API, since some conversations are configured to send a dynamic attachment for each contact, and those files must be uploaded prior to starting the conversation.

The files that are uploaded using this service are stored in the digital document repository assigned for the company for 7 days, by default.

Considerations prior to using the API

  • The company that is going to use the API must have a valid username and password in the DANAConnect platform.
  • For security reasons, the user who is going to use the API must have a special permission. Your DANAConnect Account Manager must ensure that this permission is enabled.

File Upload

Operations involved in file upload

Uploads a file

This service will allow single file uploads that later could be attached to an email. Usually, this service is used with the Conversation API Web Service, because some conversations are configured to send files to each contact, and those files must be already uploaded.

SecuritybasicAuth
Request
header Parameters
X-DEBUG
integer <int32>

Enables the requestID information on every response

Example: 1
Request Body schema: multipart/form-data
file
string <binary>

The file that will be uploaded has to be selected here

Responses
200

The server successfully processed the request

400

Incorrect Request. The request did not match the expected format

401

Authentication Error

post/file/upload
Request samples
curl -i -X POST \
-u <username@companycode>:<password>  \
https://appserv.danaconnect.com/dana/conversation/http/rest/file/upload \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-DEBUG: 1' \
-F file=@/path/to/file/FileTest.pdf 
Response samples
application/json

Successful Response without any warnings

{
  • "fileID": "s3://WS/2021/6/fc205897b3001fef760d1ac1965ecc64",
  • "fileName": "FileTest.pdf",
  • "idCompany": "companycode",
  • "requestID": "52bcb58a-4ba8-46b1-a162-34f5c7de7192"
}