POST/ng-cms/media/{projectId}smart_toyAgentic spec

Upload a media asset

Загружает файл и создает запись медиа-ресурса для проекта.

Параметры запроса

projectIdstring
Обязательный

The unique identifier of the project (bucket)

filefile
Обязательный

The file to upload. Maximum size is 10 MB. Must be sent as multipart/form-data.

titlestring
Необязательный

Human-readable title for the asset. Defaults to the filename (without extension) if omitted.

descriptionstring
Необязательный

Optional description of the media asset.

Ответы

201File uploaded and media asset created successfully. Returns the new asset ID.

тип: ApiResponse<string>

successbooleanIndicates whether the request was successful
resultstringThe ID of the newly created media asset
errorsErrorDetail[]List of errors (empty on success)
400Bad Request. No file was provided or the file is empty.
401Unauthorized. A valid bearer token is required.
412Precondition Failed. The project's current plan does not allow access to this resource, or payment is required to proceed.
500Unexpected server error.

тип: ApiResponse<T>

successbooleanAlways false
errorsErrorDetail[]List of server-side errors
correlationIdstringUnique ID for tracing the error
messagestringError message
stackstringStack trace (non-production only)

Исходный код

Референсные реализации этого эндпоинта — если поведение неочевидно, проще свериться с кодом, чем гадать.

Клиентские библиотеки

Официальные SDK для вызова этого метода из вашего кода — без ручной сборки запроса.

Konso.Clients.Cms
NuGet
dotnet add package Konso.Clients.Cms
Страница пакетаarrow_outward
@konso/cms-client
npm
npm install @konso/cms-client
Страница пакетаarrow_outward

Оставаясь на сайте, Вы даете свое согласие на использование файлов cookie