get an upload url
Get a signed url that an audio file can be uploaded to. The sha256 hash sent in the request querystring is used to check if a file matching that checksum already exists in our store.
Response
Two fields are returned in the body:
uploadUrl
anduploadId
.If the file already exists in our file store then
"uploadUrl": null
is returnedIf the file does not exists, then a signed
uploadUrl
is generated.
Responses
200 OK (Upload URL Created) / 200 OK (File Already Exists)
Content-Type: application/json
uploadobject
uploadIdstring
uploadUrlstring
{ "upload": { "uploadId": "zK3NQ1r-P7mQd9IjOKVFjlWnYAuGn3nHWTJSejljJcM", "uploadUrl": null } }
Parameters
Query Parameters
sha256
The SHA256 hash of the source file to be uploaded. It is used to determine a successful upload (we SHA256 hash the file once it is uploaded to our file store and compare the hashes for a match)
Type
string
filename
(optional) the filename for the uploaded file
Type
string
GET
/media/transcode/audio/uploadUrl
Server URL:https://api.yotoplay.com
Authorization
bearerAuth
Query Parameters
KEY | VALUE |
---|---|
Samples
curl "https://api.yotoplay.com/media/transcode/audio/uploadUrl" --header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'GET', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' } }; fetch('https://api.yotoplay.com/media/transcode/audio/uploadUrl', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yotoplay.com/media/transcode/audio/uploadUrl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer [YOUR_TOKEN]"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests url = "https://api.yotoplay.com/media/transcode/audio/uploadUrl" headers = { 'Authorization: Bearer [YOUR_TOKEN]' } response = requests.request("GET", url, headers=headers) print(response.text)