Omada API with PHP (Login fail)
Hello, I get the error when trying to connect: {"errorCode":-30109,"msg":"Invaild username or password."} What am I doing wrong?
$headers = array(
"Content-Type: application/json",
"Accept: application/json",
);
$loginInfo = array(
"name" => user,
"password" => pass
);
$chLogin = curl_init();
curl_setopt($chLogin, CURLOPT_POST, TRUE);
curl_setopt($chLogin, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($chLogin, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($chLogin, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($chLogin, CURLOPT_URL, 'https://ip:port/omadacId/api/v2/login');
curl_setopt($chLogin, CURLOPT_HTTPHEADER, $headers);
curl_setopt($chLogin, CURLOPT_POSTFIELDS, json_encode($loginInfo));
$OutputLogin = curl_exec($chLogin);
curl_close($chLogin);
echo $OutputLogin;
OutputLogin: {"errorCode":-30109,"msg":"Invaild username or password."}