POST
/ng-cms/media/{projectId}/from-urlhttps://apis-spb.konso.io/ng-cms/media/{projectId}/from-urlCreate a media asset from URL
Параметры запроса
projectIdstringThe unique identifier of the project (bucket)
Тело запроса
CreateMediaFromUrlRequesturlstringPublicly accessible URL of the remote asset to register or download
titlestringHuman-readable title for the asset. Defaults to the filename extracted from the URL if omitted.
descriptionstringOptional description of the media asset.
uploadbooleanIf true, the file is downloaded from the URL and uploaded to storage (S3). If false (default), the URL is stored as-is without downloading.
Ответы
201Media asset created successfully. Returns the new asset ID.
тип: ApiResponse<string>
successbooleanAlways true on successresultstringThe ID of the newly created media asseterrorsErrorDetail[]List of errors (empty on success)400Bad Request. No URL was provided, or when upload=true the remote URL returned a non-success HTTP status.
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 falseerrorsErrorDetail[]List of server-side errorscorrelationIdstringUnique ID for tracing the errormessagestringError messagestackstringStack trace (non-production only)Язык:
expand_more
Пример запроса
curl --request POST \
--url https://apis-spb.konso.io/ng-cms/media/{projectId}/from-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/hero.jpg",
"title": "Hero Image",
"upload": true
}'Response Example201
{
"success": true,
"result": "ma_a1b2c3d4e5f6",
"errors": []
}KONSO