My Mautic version is:4.0
My PHP version is:7.0
My Database type and version is:mysql
My problem is: I cannot figure out how this could possibly work… It is supposed to be one of the main aids in getting us started… My understanding for basic is you must now use base 64 encoding of the user and pass… and this major instruction does not even use it… Its no wonder almost no one can get the API to work… or am I not understanding what it says.
// Bootup the Composer autoloader include __DIR__ . '/vendor/autoload.php'; use Mautic\Auth\ApiAuth; session_start(); // ApiAuth->newAuth() will accept an array of Auth settings $settings = [ 'userName' => '', // Create a new user 'password' => '', // Make it a secure password ]; // Initiate the auth object specifying to use BasicAuth $initAuth = new ApiAuth(); $auth = $initAuth->newAuth($settings, 'BasicAuth'); // Nothing else to do ... It's ready to use. // Just pass the auth object to the API context you are creating.
This is what I am referring to:
$auth = $initAuth->newAuth($settings, 'BasicAuth');
The settings is the user and pw from above… and no where are they using a base 64 conversion… can this work… or or they leading every single person that tries to make heads or tails of it more confused.
This comes from the git hub library and could so easily be changed since tons of folks go there daily trying to learn to use the API… its located at GitHub - mautic/api-library: Mautic API Library
Please if I am reading this wrong… put me back on the right track.
and if it should be base 64… how can i change it to do that…