jooker 0 Posted June 23, 2020 Share Posted June 23, 2020 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 ps.: soory for my poor english i'm french ... Link to comment Share on other sites More sharing options...
Luke 37065 Posted June 23, 2020 Share Posted June 23, 2020 Hi there, have you explored our javascript api libs? https://github.com/MediaBrowser/Emby.ApiClient.Javascript/blob/master/apiclient.js#L1790 Link to comment Share on other sites More sharing options...
jooker 0 Posted June 23, 2020 Author Share Posted June 23, 2020 (edited) 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 June 23, 2020 by jooker Link to comment Share on other sites More sharing options...
Luke 37065 Posted June 23, 2020 Share Posted June 23, 2020 You can learn about that on our developer wiki: https://github.com/MediaBrowser/Emby/wiki Link to comment Share on other sites More sharing options...
jooker 0 Posted June 23, 2020 Author Share Posted June 23, 2020 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 More sharing options...
Luke 37065 Posted June 24, 2020 Share Posted June 24, 2020 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now