Jump to content

Hi there, I was wondering how do you use the Emby API?


Bastino

Recommended Posts

Bastino

Hi there, I was wondering how do you use the emby API. I know it seems rudimentary, but I wanted to know you even use it after you download it. Like a step by step.


What I actually want to do is register the user onto the platform using an external html


 


https://github.com/M...ient.Javascript


 


I guess I am bit confused, please assist


Link to comment
Share on other sites

Why, don't you start by telling us what you've done and how far you've gotten? Thanks.

Link to comment
Share on other sites

thatoneguy99

I’m not that good at it myself but something that has helped me a lot, is a program called Postman. I would start with, that and the API docs here https://github.com/MediaBrowser/Emby/wiki/Authentication. Look at the API workflow menu on the right and start with the authentication one that I linked. Don’t worry about the locating the server part just yet.

 

That will give you an idea of how to request something from the API and what the response will look like. Beyond that I haven’t done anything with the API yet either, but I have some ideas swirling around.

 

 

I’m mobile.

Edited by thatoneguy99
Link to comment
Share on other sites

Yea postman is very useful and is highly recommended. Good tip, thanks.

Link to comment
Share on other sites

AmigaZoid

If you are trying to authenticate a user in Nodejs, this is what I used

 

 

var request = require("request");
var options = { method: 'POST',
  url: 'http://localhost:8096/users/authenticateByName'
  headers:
   { 'Content-Type': 'application/json',
     'X-Emby-Authorization': 'MediaBrowser Client=\\"Android\\", Device=\\"Samsung Galaxy SIII\\", DeviceId=\\"xxx\\", Version=\\"1.0.0.0\\"' },
  body:
   { Password: 'your password as sha1',
     PasswordMd5: 'your password as Md5',
     Username: 'your username',
     Pw: 'your password' },
  json: true };
request(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});

 

For the X-Emby-Authorization line, you can change Client, Device, DeviceId, and version your your liking.

Also change the url if needed.

You will get your token with this.

 

If you are just wanting to get Postman going, make a POST to 

 

http://localhost:8096/users/authenticateByName

 

Change the ip if needed

 

In postman for authentication, set to "No Auth"

                   set headers to:   X-Emby-Authorization                MediaBrowser Client="Android", Device="Samsung Galaxy SIII", DeviceId="xxx", Version="1.0.0.0"

Content-Type application/json

Body raw:      {"Password":"your password in sha1","PasswordMd5":"your password in Md5","Username":"Your username","Pw":"your password"}

 

Hope this helps

Edited by AmigaZoid
  • Like 1
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...