# Search Requests — HelpSpot

> Searches for support requests using one or more filter criteria. See the documentation

- Key: `helpspot-search-requests`
- Type: Action (Read-only)
- Version: 0.0.2
- App: HelpSpot (`helpspot`) — https://pipedream.com/apps/helpspot.md
- This page (HTML): https://pipedream.com/apps/helpspot/actions/search-requests
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/helpspot/actions/search-requests/search-requests.mjs

## Description

Searches for support requests using one or more filter criteria. [See the documentation](https://support.helpspot.com/index.php?pg=kb.page&id=164#private.request.search)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `sSearch` | `string` | No | Full-text search string to match against request content. |
| `anyall` | `string` | No | Whether all filters must match (default) or any single filter is sufficient. |
| `xRequest` | `string` | No | The ID of the request, e.g., 12345. Options are loaded from the connected account. |
| `xCategory` | `string` | No | The category id of the request. Options are loaded from the connected account. |
| `xStatus` | `string` | No | Select a status of the request Options are loaded from the connected account. |
| `fOpen` | `integer` | No | Filter by whether the request is open or closed. |
| `xPersonAssignedTo` | `string` | No | The ID of the staff member the request is assigned to. Use the List Active Staff action to retrieve valid staff IDs. |
| `sUserId` | `string` | No | Filter by customer user ID, e.g., user_12345. |
| `sFirstName` | `string` | No | Filter by customer first name. |
| `sLastName` | `string` | No | Filter by customer last name. |
| `sEmail` | `string` | No | Filter by customer email address. |
| `sPhone` | `string` | No | Filter by customer phone number. |
| `afterDate` | `string` | No | Return requests opened after this date. Provide a Unix timestamp or a valid date string (e.g. 2024-01-01). |
| `beforeDate` | `string` | No | Return requests opened before this date. Provide a Unix timestamp or a valid date string (e.g. 2024-12-31). |
| `closedAfterDate` | `string` | No | Return requests closed after this date. Provide a Unix timestamp or a valid date string (e.g. 2024-01-01). |
| `closedBeforeDate` | `string` | No | Return requests closed before this date. Provide a Unix timestamp or a valid date string (e.g. 2024-12-31). |
| `orderBy` | `string` | No | Field name to sort results by (e.g. xRequest, sLastName, dtGMTOpened). |
| `orderByDir` | `string` | No | Sort direction for the Order By field. |
| `length` | `integer` | No | Maximum number of requests to return. |
| `fRawValues` | `boolean` | No | Set to true to return numeric IDs instead of their text representations. |
| `fIncludeTimeTotal` | `boolean` | No | Set to true to include total tracked time as iTimeTotal (seconds) and sTimeTotal (formatted string) in each result. |

## 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": "helpspot",
      },
    },
  },
)

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: "helpspot-search-requests",
  arguments: {
    sSearch: "Search Text",
    anyall: "Match Mode",
  },
})
```

**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: "helpspot-search-requests",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    helpspot: { authProvisionId: "apn_xxxxxxx" },
    sSearch: "Search Text",
    anyall: "Match Mode",
  },
})

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": "helpspot-search-requests",
    "configured_props": {
      "helpspot": { "authProvisionId": "apn_xxxxxxx" },
      "sSearch": "Search Text",
      "anyall": "Match Mode"
    }
  }'
```

---

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