# Fetch Service Reviews — Trustpilot (Customer)

> Get private reviews for a business unit. Response includes customer email and order ID. See the documentation

- Key: `trustpilot-fetch-service-reviews`
- Type: Action (Read-only)
- Version: 0.1.2
- App: Trustpilot (Customer) (`trustpilot`) — https://pipedream.com/apps/trustpilot.md
- This page (HTML): https://pipedream.com/apps/trustpilot/actions/fetch-service-reviews
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/trustpilot/actions/fetch-service-reviews/fetch-service-reviews.mjs

## Description

Get private reviews for a business unit. Response includes customer email and order ID. [See the documentation](https://developers.trustpilot.com/business-units-api#get-private-reviews-for-business-unit)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `businessUnitId` | `string` | Yes | The unique identifier for your business unit on Trustpilot Options are loaded from the connected account. |
| `language` | `string` | No | Filter reviews by language (ISO 639-1 code) |
| `page` | `integer` | No | The page to retrieve. If the page number requested is higher than the available number of pages, an empty array will be returned. |
| `stars` | `string` | No | Filter by reviews with a specific star rating. 1-5, separated by commas. |
| `internalLocationId` | `string` | No | Filter by reviews with a specific location |
| `perPage` | `integer` | No | The number of reviews to retrieve per page |
| `orderBy` | `string` | No | The order in which the results should be sorted |
| `tagGroup` | `string` | No | Filtering reviews on Tag group |
| `tagValue` | `string` | No | Filtering reviews on Tag value |
| `ignoreTagValueCase` | `boolean` | No | Ignore tag value case |
| `responded` | `boolean` | No | Filter reviews by responded state |
| `referenceId` | `string` | No | Filter reviews by reference Id |
| `referralEmail` | `string` | No | Filter reviews by referral email |
| `reported` | `boolean` | No | Filter reviews by reported state |
| `startDateTime` | `string` | No | Filter reviews by datetime range. If no time is specified, then time is implicitly 00:00:00. Format: 2013-09-07T13:37:00 |
| `endDateTime` | `string` | No | Filter reviews by datetime range. If no time is specified, then time is implicitly 00:00:00. Format: 2013-09-07T13:37:00 |
| `source` | `string` | No | Filter reviews by source |
| `username` | `string` | No | Filter reviews by user name |
| `findReviewer` | `string` | No | Filter reviews by Find Reviewer requests (contacted or not contacted) |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "trustpilot",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "trustpilot-fetch-service-reviews",
  arguments: {
    businessUnitId: "Business Unit ID",
    language: "Language",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "trustpilot-fetch-service-reviews",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    trustpilot: { authProvisionId: "apn_xxxxxxx" },
    businessUnitId: "Business Unit ID",
    language: "Language",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "trustpilot-fetch-service-reviews",
    "configured_props": {
      "trustpilot": { "authProvisionId": "apn_xxxxxxx" },
      "businessUnitId": "Business Unit ID",
      "language": "Language"
    }
  }'
```

---

- App: https://pipedream.com/apps/trustpilot.md · All apps: https://pipedream.com/apps
