# 리워드 콜백

{% hint style="warning" %}
팝콘텐츠 참여 완료시 리워드 콜백을 받을 서버의 URL과 메소드를 애드팝콘 SSP 사업실에 전달해주세요.
{% endhint %}

{% hint style="info" %}
리워드 콜백을 보낼 애드팝콘 서버의 IP는 아래와 같습니다.

* 52.193.130.252
* 35.72.69.220
* 1.232.152.178
  {% endhint %}

## Method

* GET
* POST

## Content-Type

* application/x-www-form-urlencoded  \[POST]

## Callback Parameter

| 파라미터 명         | 설명                                                  | 데이터 타입 |
| -------------- | --------------------------------------------------- | ------ |
| servicecode    | <p>리워드 서비스 코드 <br>(<code>POPCONTENTS</code> 고정)</p> | string |
| usn            | 리워드를 지급받을 유저의 아이디                                   | string |
| adid           | 유저의 구글 광고 아이디                                       | string |
| idfa           | 유저의 IDFA                                            | string |
| reward\_key    | 완료마다 발급되는 유니크한 리워드 트랜잭션 식별값                         | string |
| quantity       | 리워드 수량                                              | long   |
| service\_id    | 출석체크, 운세보기 등등 서비스의 고유 아이디                           | string |
| campaign\_id   | 유저가 참여한 캠페인의 고유 아이디                                 | string |
| campaign\_name | 유저가 참여한 캠페인의 이름                                     | string |

## Callback Response Parameter (JSON)

애드팝콘 리워드 서버에서 전달하는 리워드 지급 정보를 수신하여 처리한 후, 처리 결과를 JSON 타입으로 아래 정의된 케이스에 맞춰 응답해야합니다.

| 파라미터 명                    | 설명           | 데이터 타입  |
| ------------------------- | ------------ | ------- |
| Result                    | 리워드 지급 성공 유무 | boolean |
| [ResultCode](#resultcode) | 응답 코드        | int     |
| ResultMsg                 | 응답 메시지       | string  |

### ResultCode

| 응답코드 | 설명        | 예시                                                                     |
| ---- | --------- | ---------------------------------------------------------------------- |
| 1    | 성공        | {"Result":true,"ResultCode":1,"ResultMsg":"success"}                   |
| 3100 | 리워드 중복 지급 | {"Result":false,"ResultCode":3100,"ResultMsg":"duplicate transaction"} |
| 3200 | 유저 검증 실패  | {"Result":false,"ResultCode":3200,"ResultMsg":"invalid user "}         |
| 4000 | 예외 발생     | {"Result":false,"ResultCode":4000,"ResultMsg":"custom error message"}  |


---

# Agent Instructions: 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:

```
GET https://adpopcornssp.gitbook.io/ssp-sdk/undefined-2/popcontents/reward-callback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
