Request: POST /papi/v1/asset/[Asset id]/attachment/[Attachment id]/upload/[File name]

Uploads a file to an asset as an attachment. Attachment id is mandatory and can be accessed via UI or attachment type API command.
There is two ways defining the attachment ids, using system generated (integer) or user given (string).

Parameter Parameter Type Mandatory Description
Asset id Path yes Unique asset id to upload the new version.
Attachment id Path yes
  • System given id (integer)
  • User given key (string)
File name Path yes Filename containing the extension.
File content Body yes Request body containing the file as a binary file.
x-auth-token Header yes The authentication token must be provided as a x-auth-token header for every api request.
More information about authentication token.

Response: JSON – Asset object.
Attachment id(s) can be found from path $.AttachedFiles..FileInfo..Id

...
    "AttachedFiles": [
            {
                "AttachmentType": "imagePNG",
                "FileInfo": {
                    "Id": "1070",
...

cURL example

curl --location --request POST 'https://[EMMi instance]/papi/v1/asset/[Asset id]/attachment/[Attachment id]/upload/image.png' \
--header 'x-auth-token: [Session token]' \
--header 'Content-Type: image/png' \
--data-binary '@Downloads/robot1.png'

Tips:

To get the available attachments and ids, use the attachment type command.

Request: GET /papi/v1/asset/attachmenttype

Parameter Parameter Type Mandatory Description
x-auth-token Header yes The authentication token must be provided as a x-auth-token header for every api request.
More information about authentication token.

Response: JSON – Attachment details.
Attacment id’s JSON path is: $..Identifier

[
    {
        "Identifier": "photoshopFile",
        "Name": {
            "x-default": "Photoshop File"
        },
...
]

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment