/ng-cms/media/{projectId}https://apis-spb.konso.io/ng-cms/media/{projectId}smart_toyAgentic specUpload a media asset
Загружает файл и создает запись медиа-ресурса для проекта.
Параметры запроса
projectIdstringThe unique identifier of the project (bucket)
filefileThe file to upload. Maximum size is 10 MB. Must be sent as multipart/form-data.
titlestringHuman-readable title for the asset. Defaults to the filename (without extension) if omitted.
descriptionstringOptional description of the media asset.
Ответы
тип: ApiResponse<string>
successbooleanIndicates whether the request was successfulresultstringThe ID of the newly created media asseterrorsErrorDetail[]List of errors (empty on success)тип: ApiResponse<T>
successbooleanAlways falseerrorsErrorDetail[]List of server-side errorscorrelationIdstringUnique ID for tracing the errormessagestringError messagestackstringStack trace (non-production only)curl --request POST \
--url https://apis-spb.konso.io/ng-cms/media/{projectId} \
--header 'Authorization: Bearer <token>' \
--form 'file=@/path/to/image.jpg' \
--form 'title=Hero Image' \
--form 'description=Main banner image'{
"success": true,
"result": "ma_f1e2d3c4b5a6",
"errors": []
}Исходный код
Референсные реализации этого эндпоинта — если поведение неочевидно, проще свериться с кодом, чем гадать.
Клиентские библиотеки
Официальные SDK для вызова этого метода из вашего кода — без ручной сборки запроса.
TS