Auth0 Home Blog Docs

payload validation error 400

error
tenant
auth0-php

#1

I m trying to update tenants from php sdk but I got this error, I tried with converting array to object but not working…

code :

$data =  'guardian_mfa_page' =>  'enabled'=>false, 'html'=>''] ];
try {
       $guardianRemove = $auth0Api->tenants->update($data);
}
catch (exception $e) {
       echo($e);
}

Client error: PATCH https://mysite.com/api/v2/tenants/settings resulted in a 400 Bad Request response: {“statusCode”:400,“error”:“Bad Request”,“message”:"Payload validation error: ‘Expected type object but found type null’.


#2

I reproduced the issue and based on my limited knowledge on PHP the problem is that the library method in question is not actually sending the data it receives to the API so it then fails because it did not received any JSON payload.

I submitted an issue in the associated repository; you can keep updated by following it.


#3

I ended up also submitting a PR which is already merged so next release should resolve this.


#4