> For the complete documentation index, see [llms.txt](https://markefan.gitbook.io/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://markefan.gitbook.io/documents/index/campaigncustomerget.md).

# キャンペーン対象のリードを取得する

指定したキャンペーンの対象となっているリードを取得します。

## HTTP種類 : GET

## URL : \[BASE URL]/SpringRest/campaign/component/customer/get

## HTTP戻り値 : JSON

## パラメータ :

|      名 前      |    型   |  必 須 |
| :-----------: | :----: | :--: |
| access\_token | String | True |
|   campaignId  | Intger | True |

## JSON戻り値 例：

```javascript
{
    "code": 200,
    "message": "Success",
    "status": "OK",
    "generatedId": null,
    "generatedIds": null,
    "statusObject": "OK",
    "pagination": {
        "offset": 0,
        "nextOffset": 0,
        "prevOffset": 0,
        "limit": 1,
        "total": 1,
        "nextUrl": null,
        "prevUrl": null,
        "accountId": null,
        "message": "Data available",
        "sort": null
    },
    "data": [
        {
            "customerId": null,
            "firstName": null,
            "lastName": null,
            "name": "ancil",
            "email": null,
            "gender": null,
            "birthday": null,
            "company": null,
            "statusNew": null,
            "statusActive": null,
            "statusHot": null,
            "statusRankup": null,
            "statusRankdown": null,
            "statusWatch": null,
            "statusCWatch": null,
            "primaryStatus": {}
        }
    ]
}
```

## サンプルコード

このメソッドは指定したキャンペーンの対象となっているリードを取得します。\
このメソッドを使用するには、アクセストークンとキャンペーンIDを指定する必要があります。APIからはJSONレスポンスが返されます。

```java
private String getCampaignCustomers(String accessToken, int campaignId) {
        try {
            HttpClient client = new DefaultHttpClient();
            HttpGet httpGet = new HttpGet("<API_BASE_URL>/SpringRest/campaign/component/customer/get?access_token="
                    + accessToken+”&campaignId=”+campaignId );

            HTTP戻り値 response = client.execute(httpGet);

            if (response.getStatusLine().getStatusCode() == 200) {
                BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
                String line = "";
                while ((line = rd.readLine()) != null) {

                    return line;
                }
            }
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
```

## 呼び出し方法

```java
String response = getCampaignCustomers(“98d9a7ea-8669-45e6-b141-f663c8cb35b8”, 526);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://markefan.gitbook.io/documents/index/campaigncustomerget.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
