---
# System prepended metadata

title: TYT API  Example V3

---

# TYT API  Example V3


## Reuest 方式
+ Content-Type application/json
+ Raw Body




## 廣告細節頁
### Video [/acs2/api/v3/video]

+ Parameters
    + device_type  (require, sting) - 裝置 ID
    + topic_id     (option, string) - 館別
    + series_id    (require, string)- 系列
    + content_id   (option, string) - 單片
    
+ Parmeter example
```jsonld
{
    "device_type": "TYTPC",
    "topic_id": "5",
    "series_id" :"10939",
    "content_id" :"VOD00264847"
}
```

### View a video detail [POST]

+ Response 200 (application/json)

```jsonld
{
    "logo_tl": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "logo_tr": {
      "element_id": [
        [
          "ams00000631"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "logo_bl": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "logo_br": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "prerolls": {
      "element_id": [
        [
          "ams00006951SS03705"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 0,
      "req_timeshift": -4,
      "rewind": -8,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "jingle": {
      "element_id": [
        [
          "ams00090019"
        ],
        [
          "ams00090020"
        ]
      ],
      "partobj_ratio": 2,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10,
        10
      ],
      "adobj_sampling": [
        0,
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "midrolls": {
      "element_id": [
        [
          "ams00006958SS03715",
          "ams00006958SS03250"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 600,
      "element_sampling": 0,
      "req_timeshift": -4,
      "rewind": -8,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": 1
    },
    "postrolls": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 0,
      "req_timeshift": -4,
      "rewind": -8,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "comm_ad": {
      "element_id": [
        [
          "EmptyMC"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        1
      ],
      "filling": -1,
      "guarantee": -1
    },
    "house_ad": {
      "element_id": [
        [
          "ams00191131"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 0,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "pause_ad": {
      "element_id": [
        [
          "ams00194806"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "block_ad": {
      "element_id": [
        [
          "ams00026262"
        ]
      ],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [
        10
      ],
      "adobj_sampling": [
        0
      ],
      "filling": -1,
      "guarantee": -1
    },
    "end_ad": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "exit_ad": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "pin_ad": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "content_pool": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "vertical_ad": {
      "element_id": [],
      "partobj_ratio": 10,
      "min_interval": 0,
      "element_sampling": 1,
      "req_timeshift": 0,
      "rewind": 0,
      "adobj_ratio": [],
      "adobj_sampling": [],
      "filling": -1,
      "guarantee": -1
    },
    "elements": {
    },
    "version": "3.2.0",
    "environment": "production",
    "created_at": "2022-09-12 10:00:05"
}


```

## 橫幅式廣告
### Banner [/acs2/api/v3/banner]

+ Parameters
    + device_type(require, sting)  - 裝置 ID
    + topic_id   (option,  string) - 館別
    + series_id  (require, string) - 系列
    + session_id (option,  string) - 分類
    + content_id (option,  string) - 單片
    + unit_id    (require, array)  - 版位
    
    
+ Parmeter example
```jsonld
{
    "device_type": "TYTPC",
    "unit_id": ["29000029"],
    "topic_id": "5",
    "series_id" :"10939",
    "content_id" :"VOD00264847"
}
```
### View a banner detail [POST]

+ Response 200 (application/json)

```jsonld
{
  "29000029": {
    "elements": [      
       {
            "id": "ams00064070",
            "unit_id": "11000024",
            "users": "All",
            "media_type": "image",
            "schema": "litv",
            "space_id": "ams00064070",
            "data": "pics/ams/20211202_0000008851.png",
            "duration": 0,
            "position": "MC",
            "click_through": "http://hyperurl.co/litvmobilewebplayer",
            "purchase_url": "",
            "title": "下載APP|200427|01"
       },
    ],
  
    "version": "3.2.0",
    "environment": "production",
  }
}
```

## 版位對照表
### Unit [/acs2/api/v3/unit]

+ Parameters
    + device_type (require, sting) - 裝置 ID

+ Parmeter example
```jsonld
{
    "device_type": "TYTPC"
}
```

### View a unit detail [POST]

+ Response 200 (application/json)
```json!
{
   "data":{
        /** video **/
        "logo_tl": '29000001',
        "logo_tr": '29000001',
        "logo_bl": '29000001',
        "logo_br": '29000001',
        "prerolls": '29000002',
        "midrolls": '29000004',
        "postrolls": '29000006',
        "comm_ad": '29000008',
        "house_ad": '29000009',
        "block_ad": '29000010',
        "pause_ad": '29000011',
        "end_ad": '29000012',
        "exit_ad": '29000013',
        "pin_ad": '29000020',
        /** banner **/
        "billboard"   : "29000029",
        "leaderboard" : "29000030",
        "medium_rectangle" : "29000031"
    },
    "version": "3.2.0",
    "environment": "production",
}

```