Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

To replace a video entity, you will need to first create a new video source.

Once you have created a new video source, you can retrieve the video ID, which is required for uploading the replacement video.

A sample cURL call is shown below.

Request

Code Block
languagetext
themeConfluence
curl --location 'https://api.video-cdn.net/v1/vms/<VideoManager_ID>/videos/<VIDEO_ID>/source' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer Token' \
--data '{
    "uploadFilename": "fileName.mp4",
    "file": {
        "fileName": "fileName.mp4",
        "size": 7378888
    }
}'

Alternatively, you can use the following URL:

Code Block
https://vmproapi.movingimagevideo-cdn.comnet/vam/restv1/vms/917/<VIDEOMANAGER_ID>/<REPLACEMENTVIDEOvideos/<VIDEO_ID>/source


Parameters

Data TypeDescription
VIDEOMANAGER_IDIntegermandatory: ID of the VideoManager, to which you intend to upload the video.
Headers

ACCESS_TOKENStringmandatory: Access token (see "Authentication" for more information).
JSON BodytitleStringoptional: Title of the videodescriptionStringoptional: Description of the videokeywordsList of Stringsoptional: Keywords of the videogroupIntegeroptional: ID of the owner groupchannelIntegeroptional: ID of the channel
Content-type
Application/json
mandatory: Indicates that the request body format is JSON.
JSON Body

uploadFileName
StringName of the file to be uploaded
file



fileNameStringmandatory: Filename of the video (see suffix note below), nested property of file
autoPublish
size
Boolean
Stringoptional:
If true, the video will automatically be published after upload is complete and the 360p mp4 has been transcoded.
size of the file, nested property of file

Suffix of the fileName

The suffix of the filename is used to determine the mime type. The following table lists all supported suffixes.

Expand
titleFile Name Suffix
SuffixMime Type
mp4video/ mp4
mov

video/quicktime

flv

video/x-flv

wmv

video/x-ms-wmv

mpg

video/mpeg

avi

video/x-msvideo

mp3

audio/mpeg

mpeg

video/mpeg

m4v

video/x-m4v

vob

video/mpeg

f4v

video/x-flv

wav

audio/vnd.wave

3gp

video/3gpp

rm

audio/x-pn-realaudio

mts

video/mpeg

m2v

video/mpeg

wma

audio/x-ms-wma

mxf

application/mxf

m2p

video/mpeg

m2t

video/mpeg

mkv

video/x-matroska

webm

video/webm

qt

video/quicktime

mp2

audio/mpeg

m2ts

video/mpeg

ogvvideo/ogg


Response

Status
colourGreen
title201 CREATED
The location data of the response header will return a URL containing the newly created video ID. You will need this video ID for the next step.

Code Block
languagetext
themeConfluence
location: https://vmpro.movingimage.com/vam/restasset-in.video-cdn.net/chunks/env/prod/vms/<VIDEOMANAGER<VideoManager_ID>/videos/<VIDEO_ID>/source/<REPLACEMENT_VIDEO_ID>?bucketId=<BUCKET_ID>&fileId=<FILE_ID>&userId=<USERID>&__token__=<SECURITY_TOKEN>
Video replacement video
ParameterData TypeDescription
VIDEOMANAGER_IDIntegerID of the VideoManager, in which you intend to upload the video.
VIDEO_IDStringVideo ID of video entity to be replaced
REPLACEMENT_VIDEO
BUCKET_ID
StringPrimary bucket ID of  video file
FILE_IDString
File ID of the new
video file
USER_IDStringID of user uploading the file
SECURITY_TOKENStringAccess token used to access protected resources