---
title: "ゲストの回収(レガシー)"
slug: "retrieve-guests--legacy-"
abstract: "Sitecore CDPゲストREST APIを使ってゲストを呼び戻す方法を説明しています。"
---
# ゲストの回収(レガシー)

> !重要[このREST APIの新しいバージョン(v2.1)が利用可能です](https://api-docs.sitecore.com/cdp/guest-rest-api)。このREST APIが初めてなら、新しいバージョンを使いましょう。あるいは、すでに古いバージョンを使っているなら、[v2とv2.1の違いについて読](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/legacy-rest-apis/guest-rest-api-v2--legacy-/differences-between-v2-and-v2-1-of-the-guest-and-guest-data-extension-rest-apis.html "Differences between v2 and v2.1 of the Guest and Guest data extension REST APIs") んでアップグレードしましょう。

GET /v2/guests

ゲストのメールアドレスやその他の識別情報を使って検索します。

応答において、items.hrefにおいて、ゲスト参照は最後のスラッシュの後に続く文字列です:

"href": "<baseURL>/v2/guests/<guestRef>"

例えば、ゲスト参照を使ってゲストレコード全体とやり取りし、[取得](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/legacy-rest-apis/guest-rest-api-v2--legacy-/retrieve-a-guest--legacy-.html "Retrieve a guest (legacy)") や [更新](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/legacy-rest-apis/guest-rest-api-v2--legacy-/update-a-guest--legacy-.html "Update a guest (legacy)") を行います。

ゲスト参照を使ってSitecore CDP内のゲストに関するデータを検索することもできます。Sitecore CDPで「 **ゲスト**」をクリックします。 **Search**フィールドでゲスト参照を入力します。その後、Sitecore CDPはゲストのプロフィールを表示します。

ゲストをメールで呼び寄せる:

curl -X GET '<baseURL>/v2/guests?email=jane.doe@myretailsite.com' \\
-u '<username>:<password>' \\
-H 'Accept: application/json'

{
 "href": "<baseURL>/v2/guests?offset=0&limit=10&email=jane.doe@myretailsite.com",
 "offset": 0,
 "limit": 10,
 "items": 
 {
 "href": "<baseURL>/v2/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03"
 }
 
}

識別子によるゲストの取得:

curl -X GET '<baseURL>/v2/guests?identifiers.provider=BXLP&identifiers.id=123456' \\
-u '<username>:<password>' \\
-H 'Accept: application/json'

{
 "href": "<baseURL>/v2/guests?offset=0&limit=10&identifiers.provider=BXLP&identifiers.id=123456",
 "offset": 0,
 "limit": 10,
 "items": 
 {
 "href": "<baseURL>/v2/guests/f7aabbca-1c1b-4fc2-be72-3e16294a4f03"
 }
 
}

## リクエストをカスタマイズする

以下のクエリパラメータを使ってコレクション [を検索](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/using-a-collection-resource/searching-in-a-collection.html "Searching in a collection") できます:

-   firstName
-   lastName
-   email
-   email.untouched
-   phoneNumber
-   identifiers.provider プラス identifiers.id
-   identityStatus

以下のクエリパラメータを使って、返されたリソースを [ページ化](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/using-a-collection-resource/paginating-responses.html "Paginating responses") ・ [展開](https://doc.sitecore.com/cdp/ja/developers/api/rest-apis/legacy-rest-apis/guest-rest-api-v2--legacy-/using-link-expansion.html#UUID-bf349a03-cc74-2d12-279f-e129801d2ba2_section-idm4601636275073633411512380411 "Expanding resources") できます:

-   offset
-   limit
-   expand