deprecated error getting while mautic rest api authentication

Hello members/moderator,



I am getting below error while executing below code for authentication.



$auth = ApiAuth::initiate($settings);

$auth->validateAccessToken();



"Looks like I encountered an error (error #500). If I do it again, please report me to the system administrator! (error is deprecated as of 2.6.0 and will be removed in 3.0. Use the errors array instead.)



Please help with some solution.



thanks in advance

Hello members/moderator,

I am getting below error while executing below code for authentication.

$auth = ApiAuth::initiate($settings);
$auth->validateAccessToken();

"Looks like I encountered an error (error #500). If I do it again, please report me to the system administrator! (error is deprecated as of 2.6.0 and will be removed in 3.0. Use the errors array instead.)

Please help with some solution.

thanks in advance