Skip to content

Get Suggestion Attachment by ID

Request

Overview

The Get Suggestion Attachment by ID API allows authenticated users to get the details of an attachment that belongs to their own Suggestion. It also allows the download of attachment content.

Prerequisites

  • Enable the setting "My Suggestions" for the portal specified in the URL
  • If the user is a customer, enable the setting "Allow Customer Access" for the portal.
  • The Suggestion specified in the URL must belong to the user.
Security
oAuthUser(Required scopes:
https://api.egain.cloud/auth/kno...
)
or oAuthOnBehalfOfUser(Required scopes:
https://api.egain.cloud/auth/kno...
)
or oAuthCustomer(Required scopes:
https://api.egain.cloud/auth/kno...
)
or oAuthOnBehalfOfCustomer(Required scopes:
https://api.egain.cloud/auth/kno...
)
Path
portalIDstring, [ 7 .. 20 ] characters^[a-zA-Z0-9]{2,4}-\d{4,15}$required

The ID of the portal being accessed.

A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.

Example:PROD-1000
attachmentIDstring, [ 7 .. 20 ] characters^[a-zA-Z0-9]{2,4}-\d{4,15}$required

The ID of the attachment.

An attachment ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.

Example:PROD-1000
Query
attachmentAdditionalAttributesArray of strings

The attributes of an attachment to be returned, along with the default attachment details.

AttributeDescription
idUnique identifier for the attachment
fileNameName of the file
contentTypeContent type of the file
sizeSize of the file in bytes
linkLink to the attachment
Items Enum:"contentUrl""all"
Examples:
Single
An additional attribute to be returned.
attachmentAdditionalAttributes=["contentUrl"]
Headers
x-egain-activity-idstring, [ 4 .. 9 ] characters^[0-9]{4,9}$

A unique numeric interaction identifier from eGain.

Example:59237
x-ext-integration-idstring, <= 40 characters^[\w\W]+$

The unique numeric identifier for a tenant, used in self-service functionality as well as third-party integrations.

Note: The x-ext-integration-id and x-ext-interaction-id headers must always be provided together and cannot be supplied independently.

The x-egain-activity-id may be provided on its own, or it may be provided along with both x-ext-integration-id and x-ext-interaction-id.

Examples:
uuid
3155180e-0c13-43e9-9c38-e9045bcbf176
hex
00Dbn00000IxGnx
x-ext-interaction-idstring, <= 40 characters^[\w\W]+$

A unique interaction identifier from other CRM applications.

Note: The x-ext-integration-id and x-ext-interaction-id headers must always be provided together and cannot be supplied independently.

The x-egain-activity-id may be provided on its own, or it may be provided along with both x-ext-integration-id and x-ext-interaction-id.

Examples:
uuid
3155180e-0c13-43e9-9c38-e9045bcbf176
hex
00Dbn00000IxGnx
Accept-Languagestringrequired

The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).

Enum:"en-US""es-ES""fr-FR""it-IT""de-DE""nl-NL""pt-BR""pt-PT""da-DK""ru-RU"
Example:en-US
GET
/portals/{portalID}/suggestions/attachments/{attachmentID}
curl -i -X GET \
  'https://api.egain.cloud/knowledge/portalmgr/v4/portals/PROD-1000/suggestions/attachments/PROD-1000?attachmentAdditionalAttributes=contentUrl' \
  -H 'Accept-Language: en-US' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'x-egain-activity-id: 59237' \
  -H 'x-ext-integration-id: 3155180e-0c13-43e9-9c38-e9045bcbf176' \
  -H 'x-ext-interaction-id: 3155180e-0c13-43e9-9c38-e9045bcbf176'

Responses

Success

Bodyapplication/json
idstring, [ 7 .. 20 ] characters^[a-zA-Z0-9]{2,4}-\d{4,15}$

The ID of the Attachment.

Example:"PROD-1001"
fileNamestring, [ 1 .. 255 ] characters

The name of the Attachment file.

  • This must not exceed 255 characters.
  • sizeinteger, (int32), [ 1 .. 26214400 ]

    The size of the Attachment.

  • Limited to 25MB.
  • contentUrlstring, [ 1 .. 1024 ] characters

    The content URL of the Attachment. Download immediately, as this unique URL exists temporarily and can only be retrieved once before deletion.

    Response
    { "link": { "rel": "self", "href": "/knowledge/portalmgr/v4/portals/PROD-1000/suggestions/attachments/PROD-1001" }, "fileName": "eightbank.png", "size": 45152, "id": "PROD-1001" }