itspirit/trustpilot-authenticator

A PHP library for obtaining Trustpilot API access tokens

1.0.0 2017-07-05 06:11 UTC

This package is auto-updated.

Last update: 2024-10-29 02:52:47 UTC


README

Latest Stable Version Total Downloads License

A PHP library for obtaining Trustpilot Business User API access tokens.

Install

Install using composer:

composer install itspirit/trustpilot-authenticator

Usage

$authenticator = new Trustpilot\Api\Authenticator\Authenticator($apiKey, $apiToken, $username, $password);

$accessToken = $authenticator->getAccessToken();

// $accessToken->getToken(): string
// $accessToken->hasExpired(): bool
// $accessToken->getExpiry(): \DateTimeImmutable
// $accessToken->serialize(): string

Tests

This package use Codeception for testing. To run the tests just type

vendor/bin/codecept run