# List Bitlinks by group — Bitly

> Retrieves all Bitlinks for a given group. See the docs here

- Key: `bitly-list-bitlink-by-group`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Bitly (`bitly`) — https://pipedream.com/apps/bitly.md
- This page (HTML): https://pipedream.com/apps/bitly/actions/list-bitlink-by-group
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/bitly/actions/list-bitlink-by-group/list-bitlink-by-group.mjs

## Description

Retrieves all Bitlinks for a given group. [See the docs here](https://dev.bitly.com/api-reference#getBitlinksByGroup)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `groupGuid` | `string` | Yes | A GUID for a Bitly group |
| `size` | `string` | No | The quantity of items to be be returned |
| `page` | `string` | No | Integer specifying the numbered result at which to start |
| `keyword` | `string` | No | Custom keyword to filter on history entries |
| `query` | `string` | No | The value that you would like to search |
| `createdBefore` | `string` | No | Timestamp as an integer unix epoch |
| `createdAfter` | `string` | No | Timestamp as an integer unix epoch |
| `modifiedAfter` | `string` | No | Timestamp as an integer unix epoch |
| `archived` | `string` | No | Whether or not to include archived bitlinks |
| `deeplinks` | `string` | No | Filter to only Bitlinks that contain deeplinks |
| `domainDeeplinks` | `string` | No | Filter to only Bitlinks that contain deeplinks configured with a custom domain |
| `campaignGuid` | `string` | No | Filter to return only links for the given campaign GUID, can be provided |
| `channelGuid` | `string` | No | Filter to return only links for the given channel GUID, can be provided, overrides all other parameters |
| `customBitlink` | `string` | No | Filter to only Bitlinks that contain deeplinks |
| `tags` | `string[]` | No | Filter by given tags |
| `launchpadIds` | `string[]` | No | This is an array of strings |
| `encodingLogin` | `string[]` | No | Filter by the login of the authenticated user that created the Bitlink. This is an array of strings |

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

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: "bitly-list-bitlink-by-group",
  arguments: {
    groupGuid: "Group GUID",
    size: "Size",
  },
})
```

**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: "bitly-list-bitlink-by-group",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bitly: { authProvisionId: "apn_xxxxxxx" },
    groupGuid: "Group GUID",
    size: "Size",
  },
})

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": "bitly-list-bitlink-by-group",
    "configured_props": {
      "bitly": { "authProvisionId": "apn_xxxxxxx" },
      "groupGuid": "Group GUID",
      "size": "Size"
    }
  }'
```

---

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