Jump to content

change user password with curl command


greeniptv2016

Recommended Posts

greeniptv2016

hi friends thanks for your help
I use this command to change passwprd user but it doesn't work here is the command:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://localhost:8096/emby/Users/IDUSER/Password?api_key=APIKEY');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"CurrentPw\":\"\",\"NewPw\":\"1234\"}");

$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: MediaBrowser Client=\"testingembyclient\"';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
 

if I send this command via ssh terminal:

curl -X POST "http://217.61.22.21:8096/emby/Users/3c09dd7980f24ce7b05755ab2e9df617/Password?api_key=ba48738200f746c68c4b76d2a602e8df" -H "accept: */*" -H "Content-Type: application/json" -d "{\"CurrentPw\":\"\",\"NewPw\":\"cuck\"}"

i have this error:

Object reference not set to an instance of an object

I add that I can create users without problems
thank you
I'm waiting

errorssh.JPG

Edited by greeniptv2016
Link to comment
Share on other sites

greeniptv2016

Hi friends don't you have any idea to solve the problem?
I have tried many but nothing I can not
HELP ME PLEASE !!!

THANK YOU

Link to comment
Share on other sites

  • 1 month later...

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