jd39 Posted April 4, 2019 Report Posted April 4, 2019 What am I trying to achieve: API call and response to confirm if a Blesta customer Username/Password is valid or invalid Is this possible? Quote
0 Paul Posted April 4, 2019 Report Posted April 4, 2019 From the source docs, you may be able to use this for client login http://source-docs.blesta.com/class-ClientLogin.html API docs https://docs.blesta.com/display/dev/API That's where I would start. Quote
0 Paul Posted April 5, 2019 Report Posted April 5, 2019 16 hours ago, Tyson said: Take a look at Users::auth. Much better! Quote
0 jd39 Posted April 9, 2019 Author Report Posted April 9, 2019 <?php require_once "blesta_api.php"; $user = "apiuser"; $key = "apikey"; $url = "https://systemurl/api/"; $api = new BlestaApi($url, $user, $key); $data = array( 'vars' => array( 'username' => "example@example.com", 'password' => "examplepassword" ) ); $response = $api->get("users", "auth", $data, "any"); print_r($response->response()); print_r($response->errors()); ?> This is very new to me so would appreciate some assistance following the auth source doc. Keep getting "Internal error: Failed to retrieve the default valuestdClass Object ( [error] => stdClass Object ( [message] => An unexpected error occured. [response] => Internal error: Failed to retrieve the default value ) )" Quote
0 Tyson Posted April 9, 2019 Report Posted April 9, 2019 $data = [ 'username' => "username", 'vars' => [ 'username' => "username", 'password' => "password" ], 'type' => "any" ]; $response = $api->get("users", "auth", $data, "any"); The parameter names are the keys to the array you pass as $data. jd39 1 Quote
Question
jd39
What am I trying to achieve: API call and response to confirm if a Blesta customer Username/Password is valid or invalid
Is this possible?
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.