Jump to content

Problem with Api


Go to solution Solved by PenkethBoy,

Recommended Posts

Alan1234
Posted

Hi, I receive the Internal Error 500 when I try to change the password to a user using a generate api key (Advance -> Api Key). Instead when I use the Api key that swagger use I don't have problems. 

 

I can use the swagger's api key, but it changes every 2 days. Anyone has a solution? Thanks

PenkethBoy
Posted

use the /user/authenticatebyname end point

 

returns an access token - use this instead of the apikey generated via the UI

 

Swagger is only for testing not production - hence why the key changes

Alan1234
Posted (edited)

When I try to generate it, I receive the error

 

"Value cannot be null. (Parameter 'appName')"

 

What is wrong?

Edited by Alan1234
PenkethBoy
Posted

did you fill in the headers and body thats needed along with admin username and password

Alan1234
Posted (edited)

did you fill in the headers and body thats needed along with admin username and password

 

Yes sure

 

My question is: Why the api that I generate doesn't work?5ed6a8452febd_emby.jpg

Edited by Alan1234
Posted

You have no "appName" in your headers...

Alan1234
Posted

Emby UserId="(guid)", Client="(string)", Device="(string)", DeviceId="(string)", Version="string", Token="(string)"

 

This is the appName? I can't understand. If yes, what I need to put in "Token" and "Version"?

Posted

Sorry, it is "Client" in the header.

  • Like 1
  • Solution
PenkethBoy
Posted

put this in the text box

Emby Client="Login-testing", Device="testing", DeviceId="4567", Version="1234"

add your admin user and password below that

 

and it will work

  • Like 1
Alan1234
Posted

Yep, I have fix it, thanks to all. The error was that i put "Authorization=Emby Client="Login-testing", Device="testing", DeviceId="4567", Version="1234" " instead of "Emby Client="Login-testing", Device="testing", DeviceId="4567", Version="1234" "

 

I hope that this will help others too!! 

PenkethBoy
Posted

becasue swagger adds the authorization to your string

 

but in your code you need to add that yourself

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