VOD Station은 채널을 생성하기 위한 API를 제공하며, 생성한 채널 조회를 위해 채널 목록 조회 API와 채널 정보 조회 API를 제공합니다.
요청
POST https://vod-station.apigw.gov-ntruss.com/api/v2/channels
요청 헤더
| 헤더명 | 설명 | 
|---|---|
| x-ncp-region_code | 네이버 클라우드 플랫폼 region code x-ncp_region_code:{Region Code} | 
| x-ncp-apigw-timestamp | 1970년 1월 1일 00:00:00 협정 세계시(UTC)부터의 경과 시간을 밀리초(Millisecond)로 나타내며 API Gateway 서버와 시간 차가 5분 이상 나는 경우 유효하지 않은 요청으로 간주x-ncp-apigw-timestamp:{Timestamp} | 
| x-ncp-iam-access-key | 네이버 클라우드 플랫폼 포털에서 발급받은 Access Key ID 값x-ncp-iam-access-key:{Sub Account Access Key} | 
| x-ncp-apigw-signature-v2 | Access Key ID 값과 Secret Key로 암호화한 서명x-ncp-apigw-signature-v2:{API Gateway Signature} | 
| Content-Type | Request body content type을 application/json으로 지정Content-Type: application/json | 
요청 바디
API 요청 시 필드명의 대소문자 구분이 필요합니다.
| 필드명 | 필수 여부 | 타입 | 제약 사항 | 기본값 | 설명 | 
|---|---|---|---|---|---|
| name | Yes | String | 생성할 채널의 이름 | ||
| storageBucketName | Yes | String | 채널과 연동할 네이버 클라우드 플랫폼 Object Storage 버킷 이름 | ||
| accessPrivateFiles | No | Boolean | 연동할 Object Stroage 버킷 내 비공개 파일에 대해 VOD Station에서 접근 제한을 설정함 허용한다면 파일을 공개 처리하지 않아도 Streaming이 가능  | 
||
| protocolList[] | Yes | Array(String) | HLS, DASH | 채널의 스트리밍 프로토콜  HLS와 DASH를 지원하며, 중복 선택 가능  | 
|
| encryptionList[] | No | Array | 채널의 미디어 보호 설정 Media Encryption 기능과 DRM(FairPlay, Widevine/PlayReady) 연동 인터페이스 제공  | 
||
| encryptionList[].drmContentId | Optional | String | 숫자, 영문 1-200자 Media Encryption 설정시 필요치 않음  | 
DRM Content ID  DRM Key 요청시 해당 값을 포함해 요청하며, License 발급시 필요한 값  | 
|
| encryptionList[].drmKeyUrl | Optional | String | http(s):// 포함 URL Media Encryption 설정시 필요치 않음  | 
DRM 제공사의 CPIX API URL  VOD Station은 공식적으로 Inka Pallyacon DRM의 CPIX v1 API와의 연동 지원 DRM 패키징을 위해 VOD Station은 xml body를 포함해 POST 요청  | 
|
| encryptionList[].systemIdList | Optional | Array(String) | 공백 허용 안함, "-"허용, 256자 이하 Media Encryption 설정시 필요치 않음  | 
DRM Type 별 SystemID 설정하려는 Type에 맞는 값 입력 필요  | 
|
| encryptionList[].drmTypeCode | Optional | Integer | FairPlay: 21 Widevine/PlayReady: 22 Media Encryption 설정시 필요치 않음  | 
DRM Type 설정 필요 | |
| encryptionList[].mediaEncryptionTypeCode | Optional | Integer | AES-128: 1 DRM 설정시 필요치 않음  | 
HLS AES-128을 설정함 FairPlay와 함께 설정할 수 없음  | 
|
| encryptionList[].protocol | Yes | String | HLS, DASH | DRM 혹은 Media Encryption에 맞는 protocol을 설정함 Widevine/PlayReady: DASH FairPlay: HLS MediaEncryption: HLS  | 
|
| segmentDuration | Yes | Integer | 5-20 사이 정수 | Segment당 재생 시간 재생 시간이 길어질수록 Segment의 크기가 커지며, Client 네트워크 상태에 따라 로딩 시간이 길어질 수 있음 반면에, Segment 시간이 짧아질수록 Segment의 크기는 작아지며, 지나치게 짧게 설정 시 Client 네트워크 상태에 따라 버퍼링 발생 가능 (단위: 초)  | 
|
| segmentDurationOption | No | String | BASIC, VARIABLE | BASIC | 모든 Segment가 keyframe으로 시작하도록 Segment를 생성함 VARIABLE 옵션 선택시 설정한 segmentDuration 값과 실제 생성된 Segment의 Duration같은 차이가 발생할 수 있으며, Segment Duration이 일정하지 않을 수 있음  | 
| createCdn | Yes | Boolean | true, false | VOD Station은 CDN 연동이 필수 채널 생성 시 함께 생성하거나 별도로 생성해 사용 가능  | 
|
| cdnTypeList[] | Optional | String | createCdn을 true 설정시 필수 입력 Supported value: CDN+ | 
현재 자동 채널 생성은 CDN+만 지원하고 있으며, 별도 CDN 생성은 CDN+ 연동 가이드 참고 바람 | 
응답
| 필드명 | 타입 | 설명 | 비고 | 
|---|---|---|---|
| content | Object | VOD Station OPEN API 응답 객체 | |
| content.id | String | 생성된 채널의 ID | |
| content.name | Object | 채널 이름 | |
| content.channelStatus | Integer | 채널의 현재 상태 | CREATING, READY, STOPPING, STOPPED, TERMINATING, TERMINATED | 
| content.storageBucketName | String | 채널에 연동된 Object Storage 버킷 이름 | |
| content.encryptedBucketName | String | 채널에 연동된 Object Storage 버킷의 암호화된 이름으로 재생 URL 생성시 사용 | |
| content.accessPrivateFiles | Boolean | 버킷 내 비공개 파일에 대한 VOD Station에서의 접근 제한 설정 | |
| content.segmentDuration | Integer | 채널의 segment 재생 길이 (단위 : 초) | |
| content.segmentDurationOption | String | 채널의 segment keyframe 정렬 옵션 | |
| content.protocolList[] | Array(String) | 채널의 스트리밍 프로토콜 목록 | |
| content.createTime | Integer | 채널의 생성 시작 시간 | |
| content.readyTime | Integer | 채널의 생성 완료 시간 | |
| content.cdnCreatedTime | Integer | 채널에 연동하여 자동 생성된 CDN의 생성 시간 | |
| content.playUrl | String | CDN을 통한 재생 URL Template | |
| content.cdnStatus | String | 채널에 연동된 CDN의 상태 자동 생성하지 않으면 NOT_FOUND 로 노출  | 
|
| content.cdnDomain | String | 자동 생성된 CDN의 도메인 | |
| content.cdnServiceName | String | 자동 생성된 CDN의 서비스명 | |
| content.storageBucketStatus | String | 채널에 연동된 Object Storage 버킷의 상태 | |
| content.originPath | String | 생성한 채널의 원본 경로로 별도 CDN 생성 시 참고 | |
| content.encryptionList[] | Array | 채널의 미디어 보안 설정 | |
| content.encryptionList[].protocol | String | 미디어 보안 대상 프로토콜 | |
| content.encryptionList[].mediaEncryptionTypeCode | Integer | 미디어 보안 설정의 암호화 타입 1: AES-128 2: Sample-AES 3: CENC  | 
|
| content.encryptionList[].drmTypeCode | Intenger | 미디어 보안 설정의 DRM 타입 21: FairPlay 22: Widevine/PlayReady  | 
|
| content.encryptionList[].drmTypeName | String | 미디어 보안 설정의 DRM 타입 명 | |
| content.encryptionList[].drmContentId | String | VOD Station에서 패키징시 요청할 Content ID | |
| content.encryptionList[].systemIdList | Array(String) | VOD Station에서 패키징시 요청할 DRM System ID | |
| content.encryptionList[].drmKeyUrl | String | VOD Station에서 패키징시 요청할 DRM CPIX API URL | |
| error | Object | 오류 응답 코드 및 메시지 | |
| error.errorCode | String | 오류 응답 코드 | |
| error.message | String | 오류 응답 메시지 | |
| error.details | String | error message의 상세한 설명 api gateway 오류 발생 시 응답  | 
예시
요청 예시
POST https://vod-station.apigw.gov-ntruss.com/api/v2/channels
POST /api/v2/channels
HOST: vod-station.apigw.gov-ntruss.com
Content-Type: application/json
x-ncp-region_code:KR
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
Reqeust body (non DRM)
{
  "cdnTypeList": [
    "CDN+"
  ],
  "name": "api-guide",
  "protocolList": [
    "HLS", "DASH"
  ],
  "segmentDuration": 5,
  "storageBucketName": "vodstation-bucket"
}
Request body (DRM using MediaEncryption and Widevine/PlayReady)
{
  "cdnTypeList": [
    "CDN+"
  ],
  "createCdn": true,
  "encryptionList": [
    {
      "drmContentId": "openapi",
      "drmKeyUrl": "https://kms.example.com/cpix/token",
      "systemIdList": [
      	"9A04F079-9840-4286-AB92-E65BE0885F95",
      	"EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"
      ],
      "drmTypeCode": 22,
      "protocol": "DASH"
    },
    {
      "mediaEncryptTypeCode": 1,
      "protocol":"HLS"
    }
  ],
  "name": "api-guide-drm",
  "protocolList": [
    "HLS", "DASH"
  ],
  "segmentDuration": 5,
  "accessPrivateFiles": true,
  "storageBucketName": "vodstaton-test"
}
Request body (DRM using FairPlay and Widevine/PlayReady)
{
  "cdnTypeList": [
    "CDN+"
  ],
  "createCdn": true,
  "encryptionList": [
    {
      "drmContentId": "openapi",
      "drmKeyUrl": "https://kms.example.com/cpix/token",
      "systemIdList": [
      	"9A04F079-9840-4286-AB92-E65BE0885F95",
      	"EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"
      ],
      "drmTypeCode": 22,
      "protocol": "DASH"
    },
    {
      "drmContentId": "openapi",
      "drmKeyUrl": "https://kms.example.com/cpix/token",
      "systemIdList": [
      	"94CE86FB-07FF-4F43-ADB8-93D2FA968CA2"
      ],
      "drmTypeCode": 21,
      "protocol": "HLS"
    },
  ],
  "name": "api-guide-drm",
  "protocolList": [
    "HLS", "DASH"
  ],
  "segmentDuration": 5,
  "accessPrivateFiles": true,
  "storageBucketName": "vodstaton-test"
}
Request body (DRM using Widevine)
{
  "cdnTypeList": [
    "CDN+"
  ],
  "createCdn": true,
  "encryptionList": [
    {
      "drmContentId": "openapi",
      "drmKeyUrl": "https://kms.example.com/cpix/token",
      "systemIdList": [
      	"EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"
      ],
      "drmTypeCode": 22,
      "protocol": "DASH"
    },
  ],
  "name": "api-guide-drm",
  "protocolList": [
    "HLS", "DASH"
  ],
  "segmentDuration": 5,
  "accessPrivateFiles": true,
  "storageBucketName": "vodstaton-test"
}
Request body (using MediaEncryption Only)
{
  "cdnTypeList": [
    "CDN+"
  ],
  "createCdn": true,
  "encryptionList": [
    {
      "mediaEncryptTypeCode": 1,
      "protocol":"HLS"
    }
  ],
  "name": "api-guide-drm",
  "protocolList": [
    "HLS", "DASH"
  ],
  "segmentDuration": 5,
  "accessPrivateFiles": true,
  "storageBucketName": "vodstaton-test"
}
응답 예시
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 12 Sep 2018 09:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
{
  "content": {
    "id": "vs-20201112113327-Icwk9YO",
    "name": "api-guide-drm",
    "channelStatus": "CREATING",
    "storageBucketName": "vodstation-bucket",
    "encryptedBucketName": "zz0G2Esbn14HUBlaiZSVkg__",
    "segmentDuration": 5,
    "segmentDurationOption": "BASIC",
    "accessPrivateFiles": true,
    "protocolList": [
      "HLS",
      "DASH"
    ],
    "createTime": 1605148407,
    "cdnCreatedTime": 1605148407,
    "playUrl": "https://example.cdn.gov-ntruss.com/[protocol]/[Object Storage Bucket(encryption name)]/[path]/[video filename]/[manifest]",
    "cdnStatus": "CREATING",
    "cdnDomain": "example.cdn.gov-ntruss.com",
    "cdnServiceName": "vscdn-Icwk9YO",
    "storageBucketStatus": "RUNNING",
    "originPath": "gov-vs2-k1.video.media.ntruss.com/132/vs-20201112113327-Icwk9YO",
    "encryptList": [
      {
        "protocol": "DASH",
        "mediaEncryptTypeCode": 3,
        "mediaEncryptionTypeName": "AES-128",
        "drmTypeCode": 22,
        "drmTypeName": "Widevine/PlayReady",
        "drmContentId": "openapi",
        "systemIdList": ["9A04F079-9840-4286-AB92-E65BE0885F95", "EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"],
        "drmKeyUrl": "https://kms.example.com/cpix/token"
      },
      {
        "protocol": "HLS",
        "mediaEncryptTypeCode": 1,
        "mediaEncryptionTypeName": "AES-128"
      }
    ]
  }
}