Read mail attachments

Resource type: mailAttachments

Action Type: Read

This API call can be used to read the file attachments of an email.

Parameters:

  • emailIdentityId
    MANDATORY. STRING. Email identity ID.
  • id
    STRING. Attachment ID. If specified, only this attachment will be read, otherwise all attachments of the email.
  • getAttachmentContent
    BOOLEAN. If true, the content of the attachment is base-64 encoded in the response as getAttachmentContent.

Example:

...
    {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
        "resourceid": "NDQ5Nn4tflBvc3RlaW5nYW5n",
        "identifier": "",
        "resourcetype": "mailAttachments",
        "parameters": {
            "emailIdentityId": "e1",
            "getAttachmentContent": true
        }
    }
...

Response parameters:

  • id
    STRING. Attachment ID.
  • isInline
    BOOLEAN. Whether the attachment is an inline attachment.
  • name
    STRING. File name.
  • contentType
    STRING. Content type of the file.
  • size
    INTEGER. File size in bytes.
  • contentBytes
    STRING. Content of the file base-64 encoded.

Response example:

{
    "status": {
        "code": 200,
        "errorcode": 0,
        "message": "OK"
    },
    "response": {
        "results": [
            {
                "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
                "resourceid": "NDQ4NH4tflBvc3RlaW5nYW5n",
                "resourcetype": "mailAttachments",
                "cacheable": false,
                "identifier": "",
                "data": {
                    "meta": {
                        "cntabsolute": 1
                    },
                    "records": [
                        {
                            "id": 0,
                            "type": "",
                            "elements": {
                                "id": "ZXh0ZXJuYWx+LX5ORFE0Tkg0dGZsQnZjM1JsYVc1bllXNW5+LX4w",
                                "isInline": false,
                                "name": "Testdatei.html",
                                "contentType": "text\/HTML",
                                "size": 2336,
                                "contentBytes": "<content>"
                            }
                        }
                    ]
                },
                "status": {
                    "errorcode": 0,
                    "message": "OK"
                }
            }
        ]
    }
}