Direct Single Upload via S3

Upload a media file that is on a local machine

👍

This is part of the Platform Management API v2 beta offering. By using this documentation, you are agreeing to abide by the terms of the JW Player Beta Program Agreement.

As an alternative, you can upload content with the Platform Management API v1.


The direct upload method is the simplest way to get a locally available, smaller (<100MB) file ingested into JW Player's platform. The process involves directly uploading the file to a provided link. Because of this, the direct upload method is not resumable, and network errors will require starting over.



Upload media

Use the following steps to upload your media:

  1. Make a POST /v2/sites/{site_id}/media call to create a new media object. Within the JSON body, set upload.method to direct and define the metadata of the media item. Refer to the POST /v2/sites/site_id/media/ reference for more information about acceptable metadata body parameters.

    The API call returns a response with the upload_link location.

    In the following sample, only the media item's metadata.title is defined.
curl -X POST https://api.jwplayer.com/v2/sites/{site_id}/media \
 -H 'Authorization: Bearer {v2_api_secret}' \
 -H 'Content-Type: application/json' \
 -d '{ "upload": { "method": "direct" }, "metadata": {"title": "My Uploaded Video"} }'

  1. Upload the local media file to the upload_link location.

    If you included mime_type in the create media request, you must set the Content-Type header on the upload request to the exact same value. Similarly, if you exclude mime_type in the create media request, you must omit the Content-Type header in the upload request.
curl --upload-file {path_to_file} "{upload_link}"
curl --upload-file {path_to_file} "{upload_link}" -H 'Content-Type: {mime_type}'

  1. After the uploading process has completed, make a GET /v2/sites/{site_id}/media/{media_id} call to retrieve the media transcoding status.
curl -X GET https://api.jwplayer.com/v2/sites/{site_id}/media/{media_id} \
 -H 'Authorization: Bearer {v2_api_secret}' \
 -H 'Content-Type: application/json'


Did this page help you?