> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get E Mail From Document Attachment Id

> Get an e-mail based on an email in the archive system and attachment id

NsApiSlow threshold: 5000 ms.
<para />## Online Restricted: ## The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.



## OpenAPI

````yaml /openapi/agent/openapi-v3-EMailAgent.json post /api/v1/Agents/EMail/GetEMailFromDocumentAttachmentId
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - EMailAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/EMail/GetEMailFromDocumentAttachmentId:
    post:
      tags:
        - EMail_Agent
      summary: Get E Mail From Document Attachment Id
      description: "Get an e-mail based on an email in the archive system and attachment id\n\nNsApiSlow threshold: 5000 ms.\r\n<para />## Online Restricted: ## The EMail agent is not available in Online by default. Access must be requested specifically when app is registered."
      operationId: v1EMailAgent_GetEMailFromDocumentAttachmentId
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest
        description: DocId, AttachmentIds, IncludeAttachments
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEntity'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.EMailCarriers.GetEMailFromDocumentAttachmentIdRequest:
      description: >-
        GetEMailFromDocumentAttachmentId: Get an e-mail based on an email in the
        archive system and attachment id
      type: object
      properties:
        DocId:
          format: int32
          type: integer
        AttachmentIds:
          type: array
          items:
            type: string
        IncludeAttachments:
          type: boolean
    SuperOffice.CRM.Services.EMailEntity:
      description: "All information about an e-mail\r\n<para />\r\nCarrier object for EMailEntity.\r\nServices for the EMailEntity Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        To:
          description: To recipients of e-mail
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        Cc:
          description: Cc recipients of e-mail
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        Bcc:
          description: Bcc recipient of e-mail
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        Subject:
          description: Subject of the e-mail
          type: string
        HTMLBody:
          description: Body formatted in HTML
          type: string
        From:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        Sent:
          format: date-time
          description: When was the e-mail sent
          type: string
        Size:
          format: int32
          description: Total size of the e-mail
          type: integer
        Priority:
          description: Importance of the e-mail
          enum:
            - NoPriority
            - Highest
            - High
            - Normal
            - Low
            - Lowest
          type: string
        Flags:
          description: Flag status of this mail (unread, replied, deleted )
          enum:
            - None
            - Seen
            - Deleted
            - Recent
            - Flagged
            - Draft
            - Answered
          type: string
        MessageID:
          description: Unique id of e-mails
          type: string
        PlainBody:
          description: Body formatted in plain text
          type: string
        IsSent:
          description: Is this a sent e-mail (not new)
          type: boolean
        EMailSOInfo:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailSOInfo'
        ServerId:
          format: int32
          description: Unique id for the e-mail on the server
          type: integer
        ServerIdentifier:
          description: Server identifier of this email item (GraphApi uses string Id's)
          type: string
        Attachments:
          description: ''
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAttachment'
        CustomHeaderList:
          description: Non standard e-mail headers
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailCustomHeader'
        FolderName:
          description: Name of folder the e-mail belongs in
          type: string
        EmailItemId:
          format: int32
          description: Primary key
          type: integer
        AccountId:
          format: int32
          description: Account Id
          type: integer
        ReceivedAt:
          format: date-time
          description: Received date time
          type: string
        InReplyTo:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailEnvelope'
        RepliedAt:
          format: date-time
          description: When this email was replied at
          type: string
        HasCalendarData:
          description: If this email contains exactly one iCal appointment
          type: boolean
        CalMethod:
          description: >-
            Method stored in the associated iCal appointment. Indicates if the
            iCal data is a reply, counter proposal etc.
          enum:
            - Unknown
            - Add
            - Cancel
            - Counter
            - DeclineCounter
            - Publish
            - Refresh
            - Reply
            - Request
          type: string
        CalReplyStatus:
          description: Reply status stored in calendar data for the ical method is REPLY
          enum:
            - Unknown
            - Accepted
            - Declined
            - Tentative
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.EMailAddress:
      description: "Carrier object for EMailAddress.\r\nServices for the EMailAddress Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        ContactId:
          format: int32
          description: Primary key
          type: integer
        ContactName:
          description: ''
          type: string
        PersonId:
          format: int32
          description: Primary key
          type: integer
        PersonName:
          description: ''
          type: string
        AssociateId:
          format: int32
          description: Primary key
          type: integer
        Address:
          description: ''
          type: string
        EmailId:
          format: int32
          description: Primary key
          type: integer
        DuplicatePersonIds:
          description: All persons with this EmailAddress stored in db is listed here
          type: array
          items:
            format: int32
            type: integer
        Name:
          description: The name on the email address
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.EMailSOInfo:
      description: "Glue between SuperOffice data and an e-mail.\r\n<para />\r\nCarrier object for EMailSOInfo.\r\nServices for the EMailSOInfo Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        DocumentId:
          format: int32
          description: Primary key
          type: integer
        AppointmentId:
          format: int32
          description: Primary key
          type: integer
        ProjectId:
          format: int32
          description: Primary key
          type: integer
        SaleId:
          format: int32
          description: Primary key
          type: integer
        Archived:
          description: Is this e-mail archived in SuperOffice
          type: boolean
        ArchivedAt:
          format: date-time
          description: The datetime when this email was archived
          type: string
        ArchivedBy:
          format: int32
          description: The associate who archived this email
          type: integer
        ArchivedDisplayName:
          description: The full name of the associate who archived this email
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.EMailAttachment:
      description: "Information about an attachment\r\n<para />\r\nCarrier object for EMailAttachment.\r\nServices for the EMailAttachment Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        Description:
          description: Name/description
          type: string
        Filename:
          description: Filename
          type: string
        Size:
          format: int32
          description: Size of attachment
          type: integer
        Type:
          description: Attachment Content-Type
          type: string
        Encoding:
          description: Content-Transfer-Encoding
          type: string
        Id:
          description: Content-ID
          type: string
        Disposition:
          description: Content-Disposition
          type: string
        IsSafeFileExtension:
          description: >-
            If the user should be allowed to download and perform other actions
            on the attachment.
          type: boolean
        Stream:
          format: byte
          description: >-
            Binary stream for outgoing attachments. This property will not be
            populated for existing e-mail items.
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.EMailCustomHeader:
      description: "Carrier object for EMailCustomHeader.\r\nServices for the EMailCustomHeader Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        Name:
          description: Name of header
          type: string
        Values:
          description: ''
          type: array
          items:
            type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.EMailEnvelope:
      description: "Limited information about one e-mail.\r\n<para />\r\nCarrier object for EMailEnvelope.\r\nServices for the EMailEnvelope Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        ServerId:
          format: int32
          description: Unique id for the e-mail on the server
          type: integer
        ServerIdentifier:
          description: Unique string id for the e-mail on the server (Graph API
          type: string
        MessageId:
          description: Unique id of e-mails
          type: string
        Subject:
          description: Subject of the e-mail
          type: string
        From:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        To:
          description: To recipients of e-mail
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailAddress'
        Sent:
          format: date-time
          description: When was the e-mail sent
          type: string
        Priority:
          description: Importance of the e-mail
          enum:
            - NoPriority
            - Highest
            - High
            - Normal
            - Low
            - Lowest
          type: string
        Flags:
          description: Flag status of this mail (unread, replied, deleted )
          enum:
            - None
            - Seen
            - Deleted
            - Recent
            - Flagged
            - Draft
            - Answered
          type: string
        Size:
          format: int32
          description: Total size of the e-mail
          type: integer
        EMailSOInfo:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.EMailSOInfo'
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [SuperOffice.WebApi.Data.EMail GetEMailFromDocumentAttachmentIdRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMail_GetEMailFromDocumentAttachmentIdRequest.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
- [SuperOffice.WebApi.Agents.IEMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IEMailAgent.md)
- [Get Unsanitized E Mail From Document Attachment Id](/en/api/reference/restful/agent/email_agent/get-unsanitized-e-mail-from-document-attachment-id.md)
- [Get E Mail From Document Id Without Attachment Stream](/en/api/reference/restful/agent/email_agent/get-e-mail-from-document-id-without-attachment-stream.md)
- [Get Unsanitized E Mail From Document Id Without Attachment Stream](/en/api/reference/restful/agent/email_agent/get-unsanitized-e-mail-from-document-id-without-attachment-stream.md)
