# 리워드 지급 API

사용자가 정상적으로 캠페인 완료한 경우, 리워드를 지급하기 위해 매체 측에 리워드 지급 API를 호출합니다. 해당 API를 요청 받은 매체는 아래와 같은 요청을 처리해야 합니다.

* 사용자에게 리워드 지급
* 푸시 발송
* 완료이력 기록

API 호출 간 보안을 위해 검증 방식으로 HMAC을 사용하고 있습니다. [HMAC 생성 및 검증](/offerwall/1.0.0/campaigns-api/hmac-util.md)을 참조하여 적용해 주시기 바랍니다.

## API 명세

<mark style="color:green;">`POST`</mark>&#x20;

사용자가 캠페인 완료하는 시점에, 매체에서 정의한 리워드 지급 API URL로 다음의 요청을 전달합니다.

#### Request Body

| Name            | Type    | Description                              |
| --------------- | ------- | ---------------------------------------- |
| click\_key      | string  | 참여 완료 식별자                                |
| uid             | string  | 사용자 식별자                                  |
| advertising\_id | string  | 참여 완료한 디바이스의 광고 식별자                      |
| platform        | integer | 참여 완료한 디바이스의 플랫폼 (e.g. 1: 안드로이드, 2: iOS) |
| campaign\_id    | string  | 참여 완료한 캠페인의 ID                           |
| ad\_name        | string  | 참여 완료한 광고의 이름                            |
| reward          | integer | 사용자에게 지급할 리워드의 금액                        |
| reward\_type    | integer | 사용자에게 지급할 리워드의 타입                        |

{% tabs %}
{% tab title="200 ResponseBody 는 아래처럼 json 형식으로 응답되어야 합니다." %}

```
{ "code": 200, "message": "success" }
```

{% endtab %}

{% tab title="400 \[Code]
101, HMAC 인증 오류
102, 파라미터 오류
103, 올바르지 않은 uid
104, 중복 호출 (click\_key 중복)
400, 기타 오류 " %}

```
{ "code": {정의된 error_code}, "message": "{정의된 error_message}"}
```

{% endtab %}
{% endtabs %}

POST로 전달된 파라미터의 예는 다음과 같습니다. 매체측에 캠페인 완료 콜백 API 에서 별도로 사용하시는 파라미터 형태가 있다면 해당 내용에 맞추어 전달 드립니다. 정의된 코드와 메세지를 맞추어 주시면 응답도 형태 변경은 가능합니다.

| 파라미터명           | 값                                                                              |
| --------------- | ------------------------------------------------------------------------------ |
| click\_key      | MTYyMzkyMDE3MTcyNTo-PDpfX2lkbm9fX2JjY2pxOj48OmpQeFdUS3pUYkFSOXFBcmM0Um5Wb1B4Ug |
| uid             | 573E010013647A49B8F6B3E35E8B3C4                                                |
| advertising\_id | 9cfcf1d5-c0c1-4501-9e47-d9d0582c0ffa                                           |
| platform        | 1                                                                              |
| campaign\_id    | 3214                                                                           |
| ad\_name        | 테스트 광고 적립 완료                                                                   |
| rewad           | 100                                                                            |


---

# 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://docs.adison.co/offerwall/1.0.0/campaigns-api/complete-api.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.
