Skip to content

Create Asset

Request

Overview

Use this API to generate a signed URL for uploading an asset. Use contentUrl in response as it is used for uploading content. Make sure you upload files which have the same content type and size that was provided at the the time of signed url generation.

Scope

Client application must have 'app.conversation.conversationmgr.interaction.manage' assigned to call this API

Security
oAuthClient(Required scopes:
https://api.egain.cloud/auth/.de...
)
Bodyapplication/jsonrequired
channelobjectrequired
senderobjectrequired

recipient client application type

namestring, [ 1 .. 255 ] charactersrequired

Name of an asset with an extension.

sizeinteger, [ 1 .. 10485760 ]required
POST
/assets
curl -i -X POST \
  https://api.egain.cloud/conversation/conversationmgr/v3/assets \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "channel": {
      "type": "sms"
    },
    "sender": {
      "type": "customer"
    },
    "name": "bird.jpg",
    "size": 17245
  }'

Responses

OK

Bodyapplication/json
idstring, = 36 characters

Unique id generated for asset.

contentUrlExpirystring, (date-time)

Signed URL expiry time in GMT

Example:"2020-08-11T03:19:21.070Z"
contentUrlstring

URL to upload or download the content

Response
{ "id": "8de578e2-f7b8-462b-94b7-7d3358af9756", "contentUrl": "https://dev-storageservice-ext.ezdev.net/core/assetmgr/v3/assets/upload?signature=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXRob2QiOiJQT1NUIiwiaXNzIj", "contentUrlExpiry": "2022-01-27T20:04:25.498Z" }