Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

trustpilot_api

138 sites No security coverage
View on drupal.org

Client for consuming Trustpilot API as a service. At this time the module does not include any site builder components for Trustpilot, only a service for developers.

Technical Details

By default (with API credentials), the Trustpilot API service client can access any public endpoints. To access private endpoints, you must provide additional authentication details on the module's settings page. Once provided, the client can perform requests authenticating with OAuth.

Endpoints

Endpoints are annotation Plugins with the following properties:

  • id - Machine name for endpoint plugin.
  • name - Human name for endpoint plugin.
  • path
  • method
  • authType - Endpoint's authentication requirements. Either key or oauth
  • documentationUrl - Each endpoint provides a link to the Trustpilot API documentation. This can be found on the module's "Test" form.
  • defaultRequestParams - Default values for any request parameters documented in the Trustpilot API docs.
  • headers - Endpoint specific header requirements.

With these properties defined at the annotation level, many endpoints require no additional code beyond these annotations. See BusinessUnitReviews endpoint as an example of this.

References:

Example using the Trustpilot API client service

Using the client service, get the Trustpilot Endpoint plugin instance by machine name (id). Then use the client to perform a request to that endpoint, passing in additional
Endpoint options as the second request() method parameter.

This example assumes you've provided a Default Business Unit in the settings form. If you have not, then the businessUnitId value must be passed along to the endpoint parameters.

/** @var \Drupal\trustpilot_api\TrustpilotApiClientInterface $client */
$client = \Drupal::service('trustpilot_api.client');
$endpoint = $client->getEndpointPluginManager()->createInstance('business_unit_reviews');
$data = $client->request($endpoint, [
  'perPage' => 3,
  'stars' => [3,4,5],
]);

Activity

Total releases
3
First release
Jun 2025
Latest release
9 months ago
Release cadence
17 days
Stability
67% stable

Release Timeline

Releases

Version Type Release date
1.0.1 Stable Jul 8, 2025
1.0.0 Stable Jun 5, 2025
1.x-dev Dev Jun 5, 2025