Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Trustpilot API

152 sites No security coverage Drupal 8–11
View on drupal.org

This module provides a service for developers to interact with the Trustpilot API. It allows for consuming public and private Trustpilot endpoints, with support for authentication via API keys and OAuth.

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],
]);

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jun 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

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