> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiderx.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 광고 제공

> 광고 유닛 태그(`tagid`)와 요청 페이로드(`AdRequest`)를 기반으로 광고를 제공합니다.
라인 아이템, 크리에이티브 및 입찰 전략 데이터를 사용하여 가장 적합한 광고를 선택합니다.
DSP 응답과 내부 중재 로직을 통해 결정된 최종 광고를 반환합니다.



## OpenAPI

````yaml /openapi/decision.api.ko-dev.json post /app/v0/ad/{tagid}
openapi: 3.1.0
info:
  contact:
    email: a2support@aiderx.io
    name: A2 Support
    url: https://aiderx.io
  description: |-
    ### 소개
    Decision API는 사용자 요청 또는 컨텍스트 정보를 바탕으로 광고나 콘텐츠를 실시간으로 선택하고 배포합니다.
    빠른 응답과 동적 기능을 통해 최적의 광고 또는 추천을 제공하여 사용자가 가능한 가장 높은 가치를 얻도록 합니다.

    다양한 알고리즘, 머신러닝 모델 및 규칙 기반 로직을 적용할 수 있어 시스템이 끊임없이 변하는 조건에 유연하게 적응할 수 있습니다.
  title: Decision API
  version: dev
  x-logo:
    altText: A2 Logo
    url: >-
      https://cdn.prod.website-files.com/668de9e1f25ab5675d87758d/6690cf1bdce95af5e3522c25_a2_logo_800_250.png
servers: []
security: []
tags:
  - description: 광고 요청, 캐시 설정 및 광고 제공 모듈의 기타 매개변수를 구성하기 위한 API입니다.
    name: Ad Serving
  - description: 추천 요청을 위한 API
    name: Recommendation Serving
  - description: >-
      광고 제공 서버의 캐시를 조작하기 위한 API입니다.


      ### **중요**

      Serving 서버의 광고 또는 추천 관련 캐시 데이터를 직접 조작하는 경우 Ad Manager에서 광고 또는 추천 데이터를 함께
      수정하지 않는 것을 **강력히 권장합니다.**


      대신 모든 광고 또는 추천 데이터 변경은 Ad Manager API를 통해 처리하는 것을 **권장합니다.**

      Serving 서버에서 변경한 내용은 Ad Manager에 반영되지 않으므로 **데이터 무결성**이 손상될 수 있습니다.
    name: Cache Management
  - description: 광고 서빙 서버 설정 API
    name: Configuration
  - description: 광고 또는 추천과 관련된 전환, 노출 및 클릭 로그를 수신하는 API입니다.
    name: Ad Log
paths:
  /app/v0/ad/{tagid}:
    post:
      tags:
        - Ad Serving
      summary: 광고 제공
      description: |-
        광고 유닛 태그(`tagid`)와 요청 페이로드(`AdRequest`)를 기반으로 광고를 제공합니다.
        라인 아이템, 크리에이티브 및 입찰 전략 데이터를 사용하여 가장 적합한 광고를 선택합니다.
        DSP 응답과 내부 중재 로직을 통해 결정된 최종 광고를 반환합니다.
      parameters:
        - description: 광고 유닛의 ID입니다. 광고 관리자에서 확인할 수 있습니다.
          in: path
          name: tagid
          required: true
          schema:
            description: 광고 유닛의 ID입니다. 광고 관리자에서 확인할 수 있습니다.
            format: uuid
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdRequest'
        description: AdRequest는 광고 요청에 사용됩니다.
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                ad:
                  display:
                    banner:
                      img: https://example.com/image.jpg
                    h: 1024
                    w: 768
                  id: b56dc3bf-935d-4ee6-b1ed-f31bfc02be91
                ext:
                  ad_log: >-
                    YTU2ZDY2ZjctNDM4ZS00OTVjLWJiYTAtMjI4Mzk2MjQ0ZWVkfDA2NDI4NjYwLWY2NDMtNGVmNS05MzgzLTZjZmE1OGYxOGI2OXxjNTZkYzNiZi05MzVkLTRlZTYtYjFlZC1mMzFiZmMwMmJlOTF8NGJlMmQ4ZTYtYThhMS00NzI2LWEzMjAtNjkyNTYzMDkwZTQyfDllZjY2ZGM4LTBlMmMtNDlmMS05NDU3LWFmYmUwZGQ2ZjU3M3w1NTgxNmIzOTcxMWY5YjVhY2YzYjkwZTMxM2VkMjllNTE2NjU2MjNm
                  message: success
                version: 0.1.0
              schema:
                $ref: '#/components/schemas/AdResponse'
          description: 광고 송출 성공
        '204':
          description: 입찰 없음.
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: 요청 본문을 JSON으로 파싱하지 못했습니다.
        '415':
          content:
            text/plain:
              schema:
                type: string
          description: '`Content-Type: application/json`인 요청이 필요합니다.'
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: JSON 본문을 대상 형식으로 역직렬화하지 못했습니다.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdResponse'
          description: 유효하지 않은 tagid이거나 참조한 광고 유닛을 찾을 수 없습니다. 응답에는 JSON 오류가 포함됩니다.
      security:
        - '': []
components:
  schemas:
    AdRequest:
      description: AdRequest는 광고 요청에 사용됩니다.
      properties:
        ad_size:
          description: 광고 요청 크기입니다.
          items:
            items:
              format: int32
              type: integer
            maxItems: 2
            minItems: 2
            type: array
          type:
            - array
            - 'null'
        app:
          anyOf:
            - $ref: '#/components/schemas/ServingRequestApp'
            - type: 'null'
          description: 앱 객체입니다.
        device:
          anyOf:
            - $ref: '#/components/schemas/Device'
            - type: 'null'
          description: 디바이스 객체입니다.
          examples:
            - null
        site:
          anyOf:
            - $ref: '#/components/schemas/ServingRequestSite'
            - type: 'null'
          description: 사이트 객체입니다.
        targeting:
          description: 타기팅 키-값 쌍입니다.
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: 사용자 객체입니다.
          examples:
            - gender: M
              id: account-187acvbvz
              yob: 1988
      type: object
    AdResponse:
      properties:
        ad:
          anyOf:
            - $ref: '#/components/schemas/Ad'
            - type: 'null'
          description: 광고 객체
        errorcode:
          description: 요청이 실패한 경우의 오류 코드입니다.
          type:
            - string
            - 'null'
        ext:
          description: 선택적인 A2 전용 확장 정보입니다.
        user:
          anyOf:
            - $ref: '#/components/schemas/User'
            - type: 'null'
          description: 광고 요청에서 되돌려 받은 User 객체입니다.
        version:
          description: Version of the SDK API.
          type: string
      required:
        - version
      type: object
    ServingRequestApp:
      properties:
        bundle:
          type:
            - string
            - 'null'
        domain:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        storeurl:
          type:
            - string
            - 'null'
        ver:
          type:
            - string
            - 'null'
      type: object
    Device:
      properties:
        ext:
          description: 광고 시스템별 확장을 위한 예약 필드
        geo:
          anyOf:
            - $ref: '#/components/schemas/Geo'
            - type: 'null'
          description: 사용자의 현재 위치로 간주되는 기기의 위치 정보. Geo 객체로 정의됨.
        ip:
          description: 기기와 가장 가까운 IPv4 주소.
          type:
            - string
            - 'null'
        ua:
          description: >-
            브라우저의 User-Agent 문자열입니다. 브라우저의 원시 사용자 에이전트 문자열을 나타냅니다. 하위 호환성을 위해 최종
            사용자의 디바이스에서 사용할 수 있으면 대체 표현인 User-Agent Client-Hints로 `sua`를 채우더라도
            `ua`를 User-Agent 문자열로 채우는 것이 권장됩니다. 이 필드에는 추론하거나 근사한 사용자 에이전트를 사용하지
            않습니다. 클라이언트가 User-Agent Client Hints를 지원하고 `sua` 필드가 있으면 입찰자는 디바이스
            유형, 브라우저 유형 및 버전과 사용자 에이전트 정보에 의존하는 기타 목적을 감지할 때 `sua`를 사용하고 `ua`를
            무시하는 것이 권장됩니다. `ua`에는 동결되거나 축소된 사용자 에이전트 문자열이 포함될 수 있기 때문입니다.
          type:
            - string
            - 'null'
      type: object
    ServingRequestSite:
      properties:
        domain:
          type:
            - string
            - 'null'
        mobile:
          type:
            - boolean
            - 'null'
        name:
          type:
            - string
            - 'null'
        page:
          type:
            - string
            - 'null'
        ref:
          type:
            - string
            - 'null'
        search:
          type:
            - string
            - 'null'
      type: object
    User:
      properties:
        buyeruid:
          description: 익스체인지가 해당 바이어를 위해 매핑한 바이어별 사용자 ID
          type:
            - string
            - 'null'
        ext:
          description: OpenRTB의 익스체인지 전용 확장을 위한 필드
        gender:
          anyOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
          description: 성별. “M”은 남성, “F”는 여성, “O”는 기타로 알려진 경우를 나타냅니다. 값이 없으면 알 수 없음으로 간주됩니다.
        geo:
          anyOf:
            - $ref: '#/components/schemas/Geo'
            - type: 'null'
          description: Geo 객체(3.2.19절)로 정의된 사용자의 거주지 위치입니다. 현재 위치와는 다를 수 있습니다.
        id:
          description: 익스체인지별 사용자 ID
          type:
            - string
            - 'null'
        keywords:
          description: >-
            키워드, 관심사 또는 의도를 쉼표로 구분한 목록입니다. 'keywords'와 'kwarray' 중 하나만 사용할 수
            있습니다.
          type:
            - string
            - 'null'
        yob:
          deprecated: true
          description: 출생 연도 (4자리 정수)
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
      type: object
    Ad:
      properties:
        cat:
          description: >-
            cattax에 지정된 분류법의 ID로 광고 콘텐츠 카테고리를 설명하는 배열입니다. 구현자는 데이터 사용 및 공유에 관한
            지역 법률을 준수해야 합니다.
          items:
            type: string
          type:
            - array
            - 'null'
        cattax:
          description: 'cat 속성에 사용되는 분류법. 분류법 목록: 카테고리 분류법'
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
        display:
          anyOf:
            - $ref: '#/components/schemas/Display'
            - type: 'null'
          description: 디스플레이 광고임을 나타내는 크리에이티브 하위 유형 객체이며 관련 세부 정보를 제공합니다.
        ext:
          description: A2 확장 정보
        id:
          description: >-
            광고의 ID입니다. 벤더(예: 익스체인지나 바잉 플랫폼) 내에서 최소한 유일해야 합니다. 동일 광고가 여러 거래에 사용될
            경우 동일한 ID를 유지해야 합니다.
          type: string
        iurl:
          description: 간략한 광고 품질 확인을 위해 광고 콘텐츠를 대표하는 이미지의 캐시 버스팅 없는 URL입니다.
          type:
            - string
            - 'null'
        lang:
          description: >-
            ISO-639-1-alpha-2를 사용하는 크리에이티브의 언어입니다. 실제로 이 객체를 사용하는 벤더는 대체 표준(예:
            BCP-47)을 선택할 수 있으며, 이 경우 사전에 알려야 합니다. 크리에이티브에 언어 콘텐츠가 없으면(예: 회사 로고만
            있는 배너) 비표준 코드 “xx”도 사용할 수 있습니다.
          type:
            - string
            - 'null'
        video:
          anyOf:
            - $ref: '#/components/schemas/Video'
            - type: 'null'
          description: 비디오 광고임을 나타내는 크리에이티브 하위 유형 객체이며 관련 세부 정보를 제공합니다.
      required:
        - id
      type: object
    Geo:
      properties:
        accuracy:
          format: int32
          type:
            - integer
            - 'null'
        city:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        ext: true
        ipservice:
          anyOf:
            - $ref: '#/components/schemas/IpLocationService'
            - type: 'null'
        lastfix:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        lat:
          format: float
          type:
            - number
            - 'null'
        lon:
          format: float
          type:
            - number
            - 'null'
        metro:
          type:
            - string
            - 'null'
        region:
          type:
            - string
            - 'null'
        regionfips104:
          type:
            - string
            - 'null'
        type:
          anyOf:
            - $ref: '#/components/schemas/LocationType'
            - type: 'null'
        utcoffset:
          format: int32
          type:
            - integer
            - 'null'
        zip:
          type:
            - string
            - 'null'
      type: object
    Gender:
      enum:
        - M
        - F
        - O
      type: string
    Display:
      properties:
        adm:
          type:
            - string
            - 'null'
        api:
          items:
            format: uint16
            maximum: 65535
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
        banner:
          anyOf:
            - $ref: '#/components/schemas/Banner'
            - type: 'null'
          description: 배너 소재에 대한 배너 이미지 객체.
        ctype:
          items:
            format: uint8
            maximum: 255
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
        curl:
          type:
            - string
            - 'null'
        event:
          items:
            $ref: '#/components/schemas/Event'
          type:
            - array
            - 'null'
        ext:
          description: A2 확장 정보
        h:
          description: 절대 높이, 픽셀(DIPS) .
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        hratio:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        mime:
          description: '광고의 MIME 유형(예: “image/jpeg”).'
          type:
            - string
            - 'null'
        native:
          anyOf:
            - $ref: '#/components/schemas/NativeType'
            - type: 'null'
          description: 네이티브 광고에 대한 네이티브 객체.
        priv:
          type:
            - string
            - 'null'
        w:
          description: 절대 너비, 픽셀(DIPS).
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        wratio:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
      type: object
    Video:
      properties:
        adm:
          type:
            - string
            - 'null'
        api:
          items:
            format: uint16
            maximum: 65535
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
        ctype:
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
        curl:
          type:
            - string
            - 'null'
        dur:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        ext: true
        mime:
          items:
            type: string
          type:
            - array
            - 'null'
      type: object
    IpLocationService:
      enum:
        - 1
        - 2
        - 3
        - 4
      type: integer
    LocationType:
      enum:
        - 1
        - 2
        - 3
      type: integer
    Banner:
      properties:
        ext: true
        img:
          type: string
        link:
          anyOf:
            - $ref: '#/components/schemas/LinkAsset'
            - type: 'null'
      required:
        - img
      type: object
    Event:
      properties:
        api:
          items:
            format: uint16
            maximum: 65535
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
        cdata: true
        ext: true
        method:
          $ref: '#/components/schemas/EventTrackingMethod'
        type:
          $ref: '#/components/schemas/EventType'
        url:
          type: string
      required:
        - type
        - method
        - url
      type: object
    NativeType:
      anyOf:
        - $ref: '#/components/schemas/Native'
        - $ref: '#/components/schemas/NativeResponse'
    LinkAsset:
      description: >-
        이 객체는 네이티브 에셋을 링크 에셋으로 식별하며, 클릭 유도 문구 또는 기타 활성화 동작의 탐색 경로를 정의하는 데 사용됩니다.
        링크 에셋은 독립적으로 사용하거나 전체 네이티브 광고에 연결하여 모든 에셋의 기본값으로 사용할 수 있습니다.
      properties:
        ext: true
        trkr:
          items:
            type: string
          type:
            - array
            - 'null'
        url:
          type: string
        urlfb:
          type:
            - string
            - 'null'
      required:
        - url
      type: object
    EventTrackingMethod:
      enum:
        - 1
        - 2
      type: integer
    EventType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
      type: integer
    Native:
      properties:
        asset:
          items:
            $ref: '#/components/schemas/Asset'
          type:
            - array
            - 'null'
        ext: true
        link:
          anyOf:
            - $ref: '#/components/schemas/LinkAsset'
            - type: 'null'
      type: object
    NativeResponse:
      properties:
        assets:
          items:
            $ref: '#/components/schemas/AssetResponse'
          type:
            - array
            - 'null'
        assetsurl:
          type:
            - string
            - 'null'
        dcourl:
          type:
            - string
            - 'null'
        eventtrackers:
          items:
            $ref: '#/components/schemas/EventTrackerResponse'
          type:
            - array
            - 'null'
        ext: true
        imptrackers:
          items:
            type: string
          type:
            - array
            - 'null'
        jstracker:
          type:
            - string
            - 'null'
        link: true
        privacy:
          type:
            - string
            - 'null'
        ver:
          type:
            - string
            - 'null'
      required:
        - link
      type: object
    Asset:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/DataAsset'
            - type: 'null'
        ext: true
        id:
          format: int32
          type:
            - integer
            - 'null'
        image:
          anyOf:
            - $ref: '#/components/schemas/ImageAsset'
            - type: 'null'
        link:
          anyOf:
            - $ref: '#/components/schemas/LinkAsset'
            - type: 'null'
        req:
          anyOf:
            - $ref: '#/components/schemas/IsRequired'
            - type: 'null'
        title:
          anyOf:
            - $ref: '#/components/schemas/TitleAsset'
            - type: 'null'
        video:
          anyOf:
            - $ref: '#/components/schemas/VideoAsset'
            - type: 'null'
      type: object
    AssetResponse:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/DataAssetResponse'
            - type: 'null'
        ext: true
        id:
          format: int32
          type: integer
        img:
          anyOf:
            - $ref: '#/components/schemas/ImageAssetResponse'
            - type: 'null'
        link:
          anyOf:
            - $ref: '#/components/schemas/LinkAssetResponse'
            - type: 'null'
        required:
          anyOf:
            - $ref: '#/components/schemas/IsRequired2'
            - type: 'null'
        title:
          anyOf:
            - $ref: '#/components/schemas/TitleAssetResponse'
            - type: 'null'
        video:
          anyOf:
            - $ref: '#/components/schemas/VideoAssetResponse'
            - type: 'null'
      required:
        - id
      type: object
    EventTrackerResponse:
      properties:
        customdata: true
        event:
          format: uint16
          maximum: 65535
          minimum: 0
          type: integer
        ext: true
        method:
          format: uint16
          maximum: 65535
          minimum: 0
          type: integer
        url:
          type:
            - string
            - 'null'
      required:
        - event
        - method
      type: object
    DataAsset:
      description: >-
        이 객체는 네이티브 에셋을 데이터 에셋으로 식별합니다. 데이터 에셋은 브랜드명, 평점, 별점, 리뷰 수, 다운로드 수, 가격,
        기타 수량과 같은 다양한 요소에 사용됩니다. 현재 명세에서 고려하지 않은 네이티브 요소도 지원하도록 범용적으로 정의되었습니다.
      properties:
        ext: true
        len:
          format: int32
          type:
            - integer
            - 'null'
        type:
          anyOf:
            - $ref: '#/components/schemas/NativeDataAssetType'
            - type: 'null'
        value:
          type: string
      required:
        - value
      type: object
    ImageAsset:
      description: 이 객체는 네이티브 에셋을 이미지 에셋으로 식별합니다. 이미지 에셋은 실제 크리에이티브 이미지와 아이콘 같은 요소에 사용됩니다.
      properties:
        ext: true
        h:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        type:
          anyOf:
            - $ref: '#/components/schemas/NativeImageAssetType'
            - type: 'null'
        url:
          type: string
        w:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
      required:
        - url
      type: object
    IsRequired:
      enum:
        - 0
        - 1
      type: integer
      x-enum-varnames:
        - 'No'
        - 'Yes'
    TitleAsset:
      description: 이 객체는 네이티브 에셋을 제목 에셋으로 식별합니다. 제목 에셋은 지정된 길이의 일반 텍스트 문자열입니다.
      properties:
        ext: true
        len:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        text:
          type: string
      required:
        - text
      type: object
    VideoAsset:
      description: '이 객체는 네이티브 에셋을 비디오 에셋으로 식별합니다. 비디오 마크업(예: VAST)은 직접 포함하거나 참조해야 합니다.'
      properties:
        adm:
          type:
            - string
            - 'null'
        curl:
          type:
            - string
            - 'null'
        ext: true
      type: object
    DataAssetResponse:
      properties:
        ext: true
        len:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        type:
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
        value:
          type: string
      required:
        - value
      type: object
    ImageAssetResponse:
      properties:
        ext: true
        h:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        type:
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
        url:
          type: string
        w:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
      required:
        - url
      type: object
    LinkAssetResponse:
      properties:
        clicktrackers:
          items:
            type: string
          type:
            - array
            - 'null'
        ext: true
        fallback:
          type:
            - string
            - 'null'
        url:
          type: string
      required:
        - url
      type: object
    IsRequired2:
      enum:
        - 0
        - 1
      type: integer
      x-enum-varnames:
        - 'No'
        - 'Yes'
    TitleAssetResponse:
      properties:
        ext: true
        len:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        text:
          type: string
      required:
        - text
      type: object
    VideoAssetResponse:
      properties:
        vasttag:
          type: string
      required:
        - vasttag
      type: object
    NativeDataAssetType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 500
      type: integer
      x-enum-varnames:
        - Sponsored
        - Desc
        - Rating
        - Likes
        - Downloads
        - Price
        - SalePrice
        - Phone
        - Address
        - Desc2
        - DisplayUrl
        - CtaText
        - Other
    NativeImageAssetType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 500
      type: integer
      x-enum-varnames:
        - Icon
        - Main
        - Logo
        - Thumbnail
        - Other

````