Skip to content

Attachment

Attachment Upload API

Generate Signed URL to Upload API

Request

Overview

The Generate Signed URL to Upload API produces a signature that is used to upload an attachment.

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...
)
or oAuthAnonymousCustomer(Required scopes:
https://api.egain.cloud/auth/kno...
)
Headers
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
Bodyapplication/jsonrequired
namestring, [ 1 .. 200 ] characters^[\w\W]+$required

The name of the attachment.

sizeinteger, (int64), [ 1 .. 26214400 ]required

The size of the attachment in bytes. The maximum size is limited to 25MB.

POST
/attachment/preupload
curl -i -X POST \
  https://api.egain.cloud/knowledge/portalmgr/v4/attachment/preupload \
  -H 'Accept-Language: en-US' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "article.png",
    "size": 11889
  }'

Responses

Success

Bodyapplication/json
altIdstring, = 36 characters^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}...

The ID of the attachment.

Example:"f665fb41-6485-43c3-a2c8-c72857c29f74"
namestring, [ 1 .. 200 ] characters^[\w\W]+$

The name of the attachment.

Example:"article.png"
contentUrlstring, <= 1000 characters^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$

The content URL to upload an attachment.

Example:"https://EG5842ain.ezdev.net/knowledge/portalmgr/v4/attachmnet/upload?signature=3552656867434671616F6C51786335674B764E7848586E786B383255555A41574F6B65
Response
{ "altId": "f665fb41-6485-43c3-a2c8-c72857c29f74", "name": "article.png", "contentUrl": "https://EG5842ain.ezdev.net/knowledge/portalmgr/v4/attachmnet/upload?signature=3552656867434671616F6C51786335674B764E7848586E786B383255555A41574F6B656F542B396258677A334341322F2B32336F434D6D6E47637955714C6A6E4D527476666C534E4C6232520D0A4F6F70637259773043515A6778596949586F3247666B6E624350386336563446624C5446746C546B2F324A734E425939634758507465722B6C584435685747734C4A2B6C626342732F426E640D0A4D7965456452564A6670525069536D2B43423232384A67724F636C4161654F39336F42784942354C6776462F50724D67674A3248527253504C53457551596A7A6D4B347A4F7A63416C7047450D0A39556133495776504A4875336D77757330773D3D" }