Jump to content

Apiclient JS


Guest

Recommended Posts

Hey,

 

I would like to ask if someone could make an short idiot proof guide/tutorial how to setup the Emby Javascript Apiclient.

I try around for 2 weeks now and the closest i get is "ApiClient is undefined".

Can someone help me with this? It would be greatly appreciated!

 

Greetings

Link to comment
Share on other sites

  • 2 months later...

Bump this thread, as i fiddle with this around since months, and i cant get it to work with requirejs, bower and all that.

Edited by cyberplay
Link to comment
Share on other sites

Hi @@cyberplay. We tried to promote a family friendly environment, so please try to refrain from profanity.

 

Once you import the scripts you can just instantiate an ApiClient:

 

                            var apiClient = new ApiClient(serverAddress, appName, appVersion, deviceName,deviceId);
then call methods to talk to emby server
 
apiClient.getPublicSystemInfo().then(...);
Link to comment
Share on other sites

 

Hi @@cyberplay. We tried to promote a family friendly environment, so please try to refrain from profanity.

 

Once you import the scripts you can just instantiate an ApiClient:

 

                            var apiClient = new ApiClient(serverAddress, appName, appVersion, deviceName,deviceId);
then call methods to talk to emby server
 
apiClient.getPublicSystemInfo().then(...);

 

 

I changed my question based on your feedback, and thank you for your kind response.

Edited by cyberplay
Link to comment
Share on other sites

Need more detail/examples. thanks.

So i got it work and connect, and even login wuhu! Thanks! I was trying since months!

 

Now im standing infront of another problem.

 

You see my code down there:

qBrZx0O.png

 

With this, i can get basic information about the server, and get my personal user information.

Now i would like to get all user information, but for this i need the access token, and as you see, i store it in a variable.

Now i thought, i could call the function "setAuthenticationInfo" to set the Access Token on the X-MediaBrowser Token Header to authenticate myself.

But this function doesnt some to work that way i thought it works.

Im searching the apiclient.js now a bit and im not able to find a function which allows me to set that header.

Did i miss something?

 

Thanks for your answer :)

Link to comment
Share on other sites

May be irrelevant but it doesn't appear you waited for the system info call to complete before attempting to validate a user...

 

Perhaps if you told us exactly what you are trying to accomplish, we could help better.  Thanks.

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...