Aller au contenu

omnireview/trustpilot Référence de l’API

Étage
Fournisseur · Omnireview
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Vérifié en partie
Licence
MIT
composer require omnireview/trustpilot:1.x-dev

Lue dans les fichiers PHP du paquet au commit 16dd5a5e2f86 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnireview\Trustpilot

  • TrustpilotGateway class

    Trustpilot: the TrustScore (Data Solutions API), the reviews and the profile's links (public API, the API key), replying and inviting (the business user's OAuth token: client credentials, the business user's id).

    11 methods · 3 constants

  • TrustpilotGatewayFactory class

    Trustpilot.

    8 options · 1 method

Omnireview\Trustpilot

TrustpilotGateway class

final class TrustpilotGateway implements RatingInterface, ReviewsInterface, ReplyInterface, InviteInterface, WriteUrlInterface TrustpilotGateway.php:29

Trustpilot: the TrustScore (Data Solutions API), the reviews and the profile's links (public API, the API key), replying and inviting (the business user's OAuth token: client credentials, the business user's id).

A Place is a business unit ID - found once by the site's domain, and kept.

const API = 'https://api.trustpilot.com/v1/'
const DATA = 'https://datasolutions.trustpilot.com/v1/'
const INVITATIONS = 'https://invitations-api.trustpilot.com/v1/'

TrustpilotGateway::__construct()

public function __construct(readonly HttpClientInterface $http, readonly string $apiKey, readonly ?string $apiSecret = null, readonly ?string $businessUserId = null, readonly string $locale = 'fr-FR', readonly ?string $templateId = null, readonly ?string $replyTo = null, readonly ?string $senderName = null, readonly ?string $senderEmail = null)

TrustpilotGateway::getName()

public function getName(): string

TrustpilotGateway::getTitle()

public function getTitle(): string

TrustpilotGateway::capabilities()

public function capabilities(): Capabilities

TrustpilotGateway::terms()

public function terms(): Terms

TrustpilotGateway::find()

public function find(string $domain): Place

The business unit of a domain: once, then keep its ID.

TrustpilotGateway::rating()

public function rating(Place $place): Rating

TrustpilotGateway::reviews()

public function reviews(Place $place, int $limit = 5, ?string $language = null): array

TrustpilotGateway::reply()

public function reply(Place $place, Review $review, string $text): Reply

TrustpilotGateway::invite()

public function invite(Place $place, Invitation $invitation): ?string

TrustpilotGateway::writeUrl()

public function writeUrl(Place $place): string

TrustpilotGatewayFactory class

final class TrustpilotGatewayFactory extends GatewayFactory TrustpilotGatewayFactory.php:25

Trustpilot.

options: api_key: '%env(TRUSTPILOT_API_KEY)%' # required: the TrustScore, the reviews, the links locale: fr-FR # the profile's links (/web-links); an invitation's is its own Invitation::$locale # replying and inviting: the business user's token api_secret: '%env(default::TRUSTPILOT_API_SECRET)%' business_user_id: '%env(default::TRUSTPILOT_BUSINESS_USER_ID)%' template_id: ~ # the invitation's template reply_to: ~ sender_name: ~ sender_email: ~

Options

OptionDefault
locale'fr-FR'
api_secretnull
business_user_idnull
template_idnull
reply_tonull
sender_namenull
sender_emailnull
api_keyrequired

TrustpilotGatewayFactory::__construct()

public function __construct(readonly ?HttpClientInterface $http = null)