Creating an Asset with an External ID
Note: For more information about Backlot REST API commands, see the
Backlot API Reference.
Use POST with the /v2/assets route and be sure to include the
external_id property in the request body.
Note: Do not create a null external_id, that is, an
external_id with no value ("") or a value of
"null". Such null external IDs cannot be searched for later.
The following example creates the "My Video" video.
[POST]/v2/assets{ "name":"My Video", "file_name":"my_video.avi", "asset_type":"video", "file_size":199895, "chunk_size":100000, "external_id":"my_video" }
Backlot returns a response similar to the following.
{ "asset_type":"video", "duration":0, "name":"My Video", "external_id":"my_video" "preview_image_url":null, "created_at":"2011-07-22T18:54:19+00:00", "embed_code":"Y1dTdvMjq9QtOMGrP", "time_restrictions":null, "updated_at":"2011-07-22T18:54:19+00:00", "description":null, "status":"uploading" }
Note: Try out the code samples using your account credentials in the
Ooyala Scratchpad. To launch the Scratchpad, go
to Ooyala API Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad.