# Create Asset

# 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

Endpoint: POST /assets
Security: oAuthClient

## Description:

  - `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` (unknown)
    oauth2 scopes: https://api-qe1.ezdev.net/auth/.default

## Request fields (application/json):

  - `channel` (object, required)

  - `channel.type` (string, required)
    Channel type.

  - `sender` (object, required)
    recipient client application type

  - `sender.type` (string, required)
    type of recipient client application
    Enum: "custom_bot", "customer", "egain_agent", "egain_bot", "custom_agent"

  - `name` (string, required)
    Name of an asset with an extension.

  - `size` (integer, required)

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `id` (string)
    Unique id generated for asset.

  - `contentUrlExpiry` (string)
    Signed URL expiry time in GMT
    Example: 2020-08-11T03:19:21.070Z

  - `contentUrl` (string)
    URL to upload or download  the content

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `code` (string, required)
    String that follow the pattern {integer}-{integer}.
* The first part is http status code.  The code is unique as a whole. Nothing common between 400-101 and 404-101

  - `developerMessage` (string, required)
    Response explaining what happened

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly message only supported by some API.
* Client must request explicitly by passing X-egain-error-message=yes header

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `code` (string, required)
    String that follow the pattern {integer}-{integer}.
* The first part is http status code.  The code is unique as a whole. Nothing common between 400-101 and 404-101

  - `developerMessage` (string, required)
    Response explaining what happened

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly message only supported by some API.
* Client must request explicitly by passing X-egain-error-message=yes header

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/json):

  - `code` (string, required)
    String that follow the pattern {integer}-{integer}.
* The first part is http status code.  The code is unique as a whole. Nothing common between 400-101 and 404-101

  - `developerMessage` (string, required)
    Response explaining what happened

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly message only supported by some API.
* Client must request explicitly by passing X-egain-error-message=yes header

## Response 400 examples:

  - `Unsupported Parameters` (unknown)

  - `Invalid Value` (unknown)

  - `Missing required query parameter` (unknown)

## Response 401 examples:

  - `Invalid Authorization` (unknown)
    Invalid on expired Authorization. Generate new Authorization header and try again.

## Response 500 examples:

  - `Internal Server Error` (unknown)

