PHP library for programmatically authenticating with Vanilla Forums.
<?php
$auth = new VanillaAuthentication('http://my-forum-name.vanillaforums.com');
$auth->setCredentials('[email protected]', 'abcd1234');
try {
$response = $auth->authenticate();
} catch (\Exception $e) {
echo 'Your credentials were invalid.';
}
After authenticating, use the Guzzle client to fetch additional data as the authenticated user:
<?php
$client = $auth->getClient();
$response = $client->get('http://my-forum-name.vanillaforums.com/profile.json');
$profile = json_decode((string) $response->getBody(), true);
print_r($profile);
Tomodomo is a creative agency for magazine publishers. We use custom design and technology to speed up your editorial workflow, engage your readers, and build sustainable subscription revenue for your business.
Learn more at tomodomo.co or email us: [email protected]
This project is licensed under the terms of the MIT License, included in LICENSE.md
.
All open source Tomodomo projects follow a strict code of conduct, included in CODEOFCONDUCT.md
. We ask that all contributors adhere to the standards and guidelines in that document.
Thank you!