# 캠페인 API

## createCampaign

`POST` `https://api.pushwoosh.com/json/1.3/createCampaign`

앱 내에서 푸시 캠페인을 생성합니다.

#### 요청 본문

| 이름 | 유형 | 설명 |
| --- | --- | --- |
| auth\* | string | Pushwoosh Control Panel 의 [API access token](/ko/developer/api-reference/api-identifiers/#api-access-token). |
| application\* | string | [Pushwoosh application code](/ko/developer/api-reference/api-identifiers/#application-code) |
| name\* | string | 캠페인 이름. |
| description | string | 캠페인 설명. |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaign": "XXXXX-XXXXX"
  }
}
```
</TabItem>
</Tabs>

```
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",       // 필수. Pushwoosh Control Panel 의 API access token
    "application": "XXXXX-XXXXX",         // 필수. Pushwoosh application code
    "name": "CAMPAIGN_NAME",              // 필수.
    "description": "CAMPAIGN_DESCRIPTION" // 선택 사항.
  }
}
```

## deleteCampaign

`POST` `https://api.pushwoosh.com/json/1.3/deleteCampaign`

특정 캠페인을 삭제합니다.

#### 요청 본문

| 이름 | 유형 | 설명 |
| --- | --- | --- |
| auth\* | string | Pushwoosh Control Panel 의 [API access token](/ko/developer/api-reference/api-identifiers/#api-access-token). |
| campaign\* | string | 삭제할 [캠페인 코드](/ko/developer/api-reference/api-identifiers/#campaign-code). |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
```
</TabItem>
</Tabs>

```json title="Example"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // 필수. Pushwoosh Control Panel 의 API access token
    "campaign": "XXXXX-XXXXX"       // 필수. 삭제할 캠페인의 ID
  }
}
```

## getCampaigns

`POST` `https://api.pushwoosh.com/json/1.3/getCampaigns`

앱의 캠페인 목록을 검색합니다.

#### 요청 본문

| 이름 | 유형 | 설명 |
| --- | --- | --- |
| auth\* | string | Pushwoosh Control Panel 의 [API access token](/ko/developer/api-reference/api-identifiers/#api-access-token). |
| application\* | string | [Pushwoosh application code](/ko/developer/api-reference/api-identifiers/#application-code) |
| cursor | string | 이전 요청에서 검색된 마지막 캠페인을 나타냅니다. |
| limit | integer | 단일 응답에 대한 최대 캠페인 수입니다. |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaigns": [{
      "code": "7CFF3-63A7B",
      "name": "CAMPAIGN_NAME_1",
      "description": "DESCRIPTION1"
    }, {
      "code": "C284C-33DD3",
      "name": "CAMPAIGN_NAME_2",
      "description": "DESCRIPTION2"
    }],
    "limit": 100,
    "cursor": "+4PxJPhhwITD4PFsiKui1BA=="
  }
}
```
</TabItem>
</Tabs>

```json title="Example"
{
  "request": {
    "auth": "jLbec2UW........ztFSOf5Za",   // 필수. Pushwoosh Control Panel 의 API access token
    "application": "XXXXX-XXXXX",          // 필수. Pushwoosh application code
    "cursor": "+4PxJPhhwITD4PFsiKui1BA==", // 선택 사항. 이전 요청에서 검색된 마지막 캠페인을 나타냅니다.
    "limit": 100                           // 선택 사항. 단일 응답에 대한 최대 캠페인 수.
  }
}
```