Adding a Remote Asset Using the Backlot REST API

Before you can manage a Remote Asset, you must add it to Backlot.

Note: For more information about Backlot REST API commands, see the Backlot API Reference.

To add a remote asset:

Use the /v2/assets route. The following example creates the "My Remote Asset" remote asset.
[POST]/v2/assets{  
   "name":"My Remote Asset",
   "asset_type":"remote_asset",
   "duration":120000,
   "stream_urls":{  
      "flash":"http://mydomain.com/my_flash_file.flv",
      "iphone":"http://mydomain.com/iphone_compatible_file.mp4"
   }
}

Backlot returns a response similar to the following.

{  
   "asset_type":"remote_asset",
   "duration":120000,
   "name":"My Remote Asset",
   "preview_image_url":null,
   "created_at":"2011-05-16T20:35:53+00:00",
   "embed_code":"Y1NWZnMjq-DPsM2",
   "stream_urls":{  
      "flash":"http://mydomain.com/my_flash_file.flv",
      "iphone":"http://mydomain.com/iphone_compatible_file.mp4"
   },
   "time_restrictions":null,
   "updated_at":"2011-06-02T00:08:58+00:00",
   "external_id":"myExternalId",
   "hosted_at":null,
   "original_file_name":null,
   "description":null,
   "status":"live"
}
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

The remote asset is successfully added.

해당 내용이 도움 되었습니까?