Jump to content

endpoint : next up ?


jooker

Recommended Posts

jooker

hi,

i have a dedicated server with emby, i have for this dedicated server a dashboard web page.

I am testing the API, but I can't find the endpoint to get "next up" like home page of emby

image.png.022d77791da898633717e8a5192214a6.png

ps.: soory for my poor english i'm french ...

Link to comment
Share on other sites

jooker

Hi Luke,

no sorry, i work with http://swagger.emby.media/?url=xxxx and I searched all afternoon

I call api in php with file_get_contents($apiurl,false, $context)

with this header

'http'=>array(
            'method'=>"GET",
            'header'=>    "X-Emby-Token:"  .$apikey . "\r\n" . 
            "Accept: application/json\r\n"
            )

after see your js code i've found it !

and it's work fine with $apiurl = $embiurl.'Shows/NextUp?EnableImages=true&UserID=xxxxxx

thank's a lot !

can i make an header for userid ?

 

Edited by jooker
Link to comment
Share on other sites

jooker

yes i've see this page https://github.com/MediaBrowser/Emby/wiki/User-Authentication

this my code with the header X-Emby-Authorization


$jsonretour = array();
$apikey='myapikey';
$userid='myuserid';
$embiurl='https://emby.mysite.com/';


$opts = array(
		'http'=>array(
			'method'=>"GET",
			'header'=>	"X-Emby-Token:"  .$apikey . "\r\n" . 
			"Accept: application/json\r\n" . 
			"X-Emby-Authorization: Client=Android, Device=Samsung Galaxy SIII, DeviceId=xxx, Version=1.0.0.0, Emby UserId="  .$userid . "\r\n"
			)
		);
$context = stream_context_create($opts);
$apiurl = $embiurl.'Shows/NextUp?EnableImages=true';
$jsonresponse = file_get_contents($apiurl,false, $context);
$jsonretour = json_decode ($jsonresponse, true);

echo $apiurl.'<br>';
echo '<pre>';
print_r($jsonretour);
echo '</pre>';

i get an error 500 from api

but without the X-Emby-Authorization and with the param UserId= in url, it's work

it's ok for me, it was just to do well 🙂

 

 

Link to comment
Share on other sites

If you have an api key generated by the server dashboard then you can skip the headers and just use the api_key param.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...