Guest Posted August 18, 2017 Share Posted August 18, 2017 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 More sharing options...
Guest Posted October 21, 2017 Share Posted October 21, 2017 (edited) 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 October 21, 2017 by cyberplay Link to comment Share on other sites More sharing options...
Luke 37046 Posted October 21, 2017 Share Posted October 21, 2017 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 More sharing options...
Guest Posted October 21, 2017 Share Posted October 21, 2017 (edited) 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 October 21, 2017 by cyberplay Link to comment Share on other sites More sharing options...
Luke 37046 Posted October 21, 2017 Share Posted October 21, 2017 Need more detail/examples. thanks. Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2017 Share Posted October 21, 2017 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: 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 More sharing options...
Luke 37046 Posted October 22, 2017 Share Posted October 22, 2017 It does that automatically Link to comment Share on other sites More sharing options...
ebr 14910 Posted October 22, 2017 Share Posted October 22, 2017 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 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