Retrieve [`PartnerLink`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#partnerlink) resources by sending a [`SearchPartnerLinksRequest`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#searchpartnerlinksrequest).

The `parent` field of the request is required. Set the `parent` to the resource
name of a specific account, using the format:

    accountTypes/{account_type}/accounts/{account}

For flexibility across different use cases, the [`SearchPartnerLinksResponse`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#searchpartnerlinksresponse)
contains all of the `PartnerLink` resources where the `parent` in the request is
either:

- The account identified by the `owner_account` field
- The account identified by the `partner_account` field

[Set request headers](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/retrieve-partner-links#headers) if you are accessing the `parent` account using
a partner link, a parent Google Ads manager account, or a parent Display \& Video 360 partner
account.

[Filter results](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/retrieve-partner-links#filter) to limit the response to resources with specific
attributes.

The `Search` method returns pages of results. To retrieve all resources for a
request, check the `next_page_token` and [paginate results](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/retrieve-partner-links#paginate).

## Set request headers

The `Search` method supports the `login-account` header
to define the access path of your credentials to the `parent` account in the
request. The `linked-account` header is not supported for [`PartnerLinkService`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#partnerlinkservice)
methods.

Refer to [Destinations and headers](https://developers.google.com/data-manager/api/devguides/concepts/destinations#resource-management) for details
and instructions on how to set the headers for different access scenarios.

## Filter results

Use the `filter` field of the request to retrieve specific partner links. The
`filter` field is a string that defines the set of conditions you want to apply,
along with whether the API should combine the conditions using `AND` or `OR`.
Read more about filtering options and syntax in
[AIP-160: Filtering](https://google.aip.dev/160).

You can define the `filter` using the `account_id` of either the owning account
or the partner account:

- `owning_account.account_id`: The `account_id` of the owning account.
- `partner_account.account_id`: The `account_id` of the partner account.

For example, here's a `filter` that returns all partner links where the owning
account has account ID `OWNING_ACCOUNT_ID`:

    owning_account.account_id = OWNING_ACCOUNT_ID

Here's another example of a `filter`. This returns all partner links where the
owning account has account ID `OWNING_ACCOUNT_ID` or the
partner account has account ID
`PARTNER_ACCOUNT_ID`:

    owning_account.account_id = OWNING_ACCOUNT_ID OR partner_account.account_id = PARTNER_ACCOUNT_ID

Modifying that `filter` to use `AND` instead of `OR` limits the returned
resources to the partner links where *both* the owning account has account ID
`OWNING_ACCOUNT_ID` *and* the partner account has account ID
`PARTNER_ACCOUNT_ID`:

    owning_account.account_id = OWNING_ACCOUNT_ID AND partner_account.account_id = PARTNER_ACCOUNT_ID

## Paginate results

Use the `page_size` field to control the number of results returned in a single
response. For example, if you set `page_size` to `10`, the API will return *at
most* 10 results per response. It's possible that the API will return fewer than
10 results if there are fewer than 10 results that match your request.

The default `page_size` is 50 and the maximum is 1000.

If there are more results than can fit in a single response, the response will
include a `next_page_token`. To retrieve the next page, or set of results, send
the same request again with the `page_token` field set to this value. All other
parameters must be the same as the previous request.

If the `next_page_token` field is not included in the response, this indicates
that there are no more results.