Jump to content
  • 0

Customer User/Password Validation Via API


Question

5 answers to this question

Recommended Posts

  • 0
Posted
<?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 ) )"

  • 0
Posted
$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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...