8 API Reference‎ > ‎Resources‎ > ‎

Attachment

NOTE: Used only in Submission API.

Represents an attachment.

Attributes (read-only):
  • id string.
  • file_name string.
  • file_size integer. The file size is measured in kilobytes.
  • download_url string.

Data Examples

JSON

"attachment": {
    "id": "",
    "file_name": "",
    "file_size": "",
    "download_url": ""
}

XML

<attachment>
    <id></id>
    <file_name></file_name>
    <file_size></file_size>
    <download_url></download_url>
</attachment>

Actions

Create Attachment


POST /attachments

Request (Content-type should be multipart/form-data)

{
    "attachment": {
        "media": ""
    }
}

Response

HTTP/1.1 200 OK {     "status": "OK",     "attachment": {         "id": "erfu2098fu2uer02fu0reu2290e8fr",         "file_name": "",         "file_size": "",         "download_url": ""     } }

Example of request using curl utility

curl -X POST -F attachment[media]=@/path/to/file -H "Accept: application/json" -H "X-ADILITY-API-KEY:YOUR_API_KEY" "http://testapi.adility.com/submission/beta/attachments"

Delete Attachment


DELETE /attachments/:id

JSON

Response

HTTP/1.1 200 OK {     "status": "OK" }


XML

Response

HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <response>     <status>OK</status> </response>




Comments