Asset API

Getting Started

  • Base URL: https://api.videoplaza.com/v1/assets.
  • Requests: GET and POST requests are used. You pass parameters by using common REST parameters like PATH and QUERY, as well as HTTP HEADERS. The body of the requests should be provided in JSON format and encoded using UTF-8. The only exception to this rule is when you provided a serialised format of an asset when uploading it to Pulse. In this case, the body is an octet-stream.
  • Responses: All responses contain an HTTP status code in the header and the body is in JSON format.
  • Swagger documentation: https://api.videoplaza.com/v1/swagger
  • Related user documentation:
Note: Only successful responses are shown in the examples. Details about unsuccessful responses are found in the swagger documentation.

Upload Video Assets

Note: You cannot upload pre-transcoded assets through the API, which is possible if you upload them through Pulse.
You can upload video assets to Ooyala Pulse through the Asset API by providing, in the request body, either:
  • a URL to the video asset, or
  • the video asset itself as an octet-stream.

Uploaded video assets are only transcoded after they have been associated with at least one ad. The progress of transcoding can be followed in the asset factory in Pulse. For more information, refer to Ad API.

Upload a Video Asset by Providing a URL

Method POST
URL https://api.videoplaza.com/v1/assets/video
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body
{
  "name":"<string>",
  "downloadUri":"<string>"
}
Note: The name parameter in the body needs to contain the correct file extension for the asset.
Success response

HTTP status: 201 Created

Header: Location: URI to the location of your asset

Body: -

Example:

Request header:

POST v1/assets/video HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
  "name":"videoname.mp4",
  "downloadUri":"http://example.com/video/1234"
}

Success response:

HTTP status:
  201 (Created)

Header:
  Location: <URI with the location of your asset>

Upload a Video Asset by Providing the Serialised Asset

Method POST
URL https://api.videoplaza.com/v1/assets/video
Header Authentication header (x-o-api-key)
Content type application/octet-stream
URL params -
Query params fileName: name of the file to upload
Body
<your video asset as an octet-stream>
Success response

HTTP status: 201 Created

Header: Location: URI to the location of your asset

Body: -

Example:

Request header:

POST v1/assets/video?fileName='videoname.mp4' HTTP/1.1
Host: api.videoplaza.com
Content-type: application/octet-stream
x-o-api-key="<your key>"

Request body:

<your video asset as an octet-stream>

Success response:

HTTP status:
  201 (Created)

Header:
  Location: <URI with the location of your asset>

Upload Other Assets

Note: Assets uploaded through this endpoint are never transcoded, which means retrieving asset metadata always returns "transcondingStatus": "NOT_AVAILABLE".
You can upload other asset types, like ad images and flash files, to Ooyala Pulse through the Asset API by providing, in the request body, either:
  • a URL to the asset, or
  • the asset itself as an octet-stream.

For information on how to link an asset to an ad, refer to Ad API.

Upload an Image Asset by Providing a URL

Method POST
URL https://api.videoplaza.com/v1/assets/resource
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body
{
  "name":"<string>",
  "downloadUri":"<string>"
}
Note: The name parameter in the body needs to contain the correct file extension for the asset.
Success response

HTTP status: 201 Created

Header: Location: URI to the location of your asset

Body: -

Example:

Request header:

POST v1/assets/resource HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
  "name":"imagename.jpeg",
  "downloadUri":"http://example.com/image/1234"
}

Success response:

HTTP status:
  201 (Created)

Header:
  Location: <URI with the location of your asset>

Upload an Image Asset by Providing the Serialised Asset

Method POST
URL https://api.videoplaza.com/v1/assets/resource
Header Authentication header (x-o-api-key)
Content type application/octet-stream
URL params -
Query params fileName: name of the file to upload
Body
<your asset as an octet-stream>
Success response

HTTP status: 201 Created

Header: Location: URI to the location of your asset

Body: -

Example:

Request header:

POST v1/assets/resource?fileName='imagename.jpeg' HTTP/1.1
Host: api.videoplaza.com
Content-type: application/octet-stream
x-o-api-key="<your key>"

Request body:

<your asset as an octet-stream>

Success response:

HTTP status:
  201 (Created)

Header:
  Location: <URI with the location of your asset>

Retrieve Asset Metadata

This endpoint allows you to retrieve the metadata (name and transcoding status) for an asset.

Method GET
URL https://api.videoplaza.com/v1/assets/{id}
Header Authentication header (x-o-api-key)
Content type application/json
URL params ID of the asset
Query params -
Body -
Success response

HTTP status: 200 OK

Header: -

Body:

{
  "name":"<string>",
  "id":"<string>",
  "transcondingStatus":"<NOT_AVAILABLE|FAILED|INITIAL|UPLOADING|TRANSCODING|DOWNLOADING|FINISHED>"
}

Example:

Request header:

GET v1/assets/df3d2ad9-2c83-4ee1-b2ca-388c3d302f40 HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response:

HTTP status:
  200 (OK)

Body:
{
  "name":"filename.mp4",
  "id":"df3d2ad9-2c83-4ee1-b2ca-388c3d302f40",
  "transcondingStatus":"FINISHED"
}

Was this article helpful?