This operation is authorized to any partner of the line item.

On Winddle, attachments are only containers for versions, which contain the actual file. Although versions_attributes is an array, only one version of a datafile can be created / request - the array should only contain one element describing the version.

There are 3 ways to upload an attachment on Winddle (in order of priority if more than one provided):

  • By providing a base64 data string that represents the file
  • By providing a remote url (public)
  • By providing the file directly in the body of the multipart request

Here are the fields for the elements in the versions_attributes array:

NameType
noteNote for that version
base64_dataFile content encoded in base 64
remote_attached_urlString (unique, max 255 chars)
attachedFile (HTML multipart form)

Examples

POST /line_items/:line_item_id/attachments

{
  name: "MyFile.png",
  versions_attributes: [{
    note: "Direct upload from our FTP",
    remote_attached_url: "ftp://www.mycompany.com/images/my_file.png"
  }]
}

Params

Param name Description
source_id
optional

ID in Customer’s source system (optional, max 255 char.)

Must be a String
name
optional

A name for the attachment. If no name provided, filename will be used

Must be a String
label
optional

The ‘folder’ (virtual) for his attachment

Must be a String
versions_attributes
optional

an array of versions

An array of versions. Here is a list version attributes * base64_data allow you to submit an image as a base64 string * attached a file, any kind of format * remote_attached_url an url to find a file. the file is downloaded asynchronously. Please observe that * you can only submit a version at a time * you should only use one of the three attributes