Skip to content

Instantly share code, notes, and snippets.

@halvardos
Created March 10, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halvardos/d3288d9ed3fa2435b7b57c1ba2a5c049 to your computer and use it in GitHub Desktop.
Save halvardos/d3288d9ed3fa2435b7b57c1ba2a5c049 to your computer and use it in GitHub Desktop.
<?php
require __DIR__ . '/vendor/autoload.php';
use SYNQ\lib\API;
// Init with api key and base url
$api = new API(getenv('SYNQ_API_KEY'), 'https://api.synq.fm/v1/');
// Create a new video object
$result = $api->video->create($userdata = ['test' => 123]);
// Get the video id of the object we just created
$body = json_decode($result->getBody());
$videoId = $body->video_id;
// Call uploader to get an embeddable url
$result = $api->video->uploader($videoId);
$body = json_decode($result->getBody());
echo $body->uploader_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment