MENU
      Callback Endpoint 등록
        • PDF

        Callback Endpoint 등록

        • PDF

        기사 요약

        Live Station 에서 발생한 이벤트를 수신할 수 있는 Callback Endpoint 를 등록하는 API 입니다.
        Callback Endpoint는 전체 채널에 대한 콜백 설정과 개별 채널 콜백 설정을 구분하여 이용하실 수 있습니다.

        Callback 발송 데이터

        Callback endpoint 를 등록하면 Live Station 에서 이벤트가 발생할 때마다 설정된 endpoint URL 로 아래와 같은 형태의 데이터가 전송됩니다. (HTTP POST 사용)

        Callback 발송 응답 바디

        필드명필수 여부타입제약 사항설명
        idYesString
        logLevelYesString
        channelIdYesString
        eventYesString
        timestampYesString

        Callback 발송 응답 예시

        {
               "id": 1234,
               "logLevel": "INFO",
               "channelId": "ls-20200327140131-aBCD3",
               "event": "STREAM_UPDATE",
               "timestamp": 1599218791425
        }
        JSON

        요청

        EndpointDescription
        [POST https://livestation.apigw.ntruss.com/api/v2/events/callbackEndpoint]전체 채널 콜백 설정 (N(채널) : 1(콜백 엔드포인트))
        [POST https://livestation.apigw.ntruss.com/api/v2/channels/{channelId}/callbackEndpoint]일반 채널 채널별 콜백 설정 (1(채널) : 1(콜백 엔드포인트))
        [POST https://livestation.apigw.ntruss.com/api/v2/re-stream/channels/{channelId}/callbackEndpoint]리스트림 채널 채널별 콜백 설정 (1(채널) : 1(콜백 엔드포인트))
        [POST https://livestation.apigw.ntruss.com/api/v2/vod/channels/{channelId}/callbackEndpoint]VOD 채널 채널별 콜백 설정 (1(채널) : 1(콜백 엔드포인트))

        요청별 콜백 발송 동작

        채널별 콜백 엔드포인트전체 채널 콜백 엔드포인트동작
        미설정미설정콜백 발송하지 않음
        미설정설정전체 채널 콜백 엔드포인트로 발송
        설정미설정특정 채널에 설정한 콜백 엔드포인트로 발송
        설정설정특정 채널에 설정한 콜백 엔드포인트로 발송

        요청 헤더

        헤더명필수 여부설명
        x-ncp-apigw-timestampYES1970년 1월 1일 00:00:00 협정 세계시(UTC)부터의 경과 시간을 밀리초(Millisecond)로 나타내며 API Gateway 서버와 시간 차가 5분 이상 나는 경우 유효하지 않은 요청으로 간주
        x-ncp-apigw-timestamp:{Timestamp}
        x-ncp-iam-access-keyYES네이버 클라우드 플랫폼 포털에서 발급받은 Access Key ID 값
        x-ncp-iam-access-key:{Sub Account Access Key}
        x-ncp-apigw-signature-v2YESAccess Key ID 값과 Secret Key로 암호화한 서명
        x-ncp-apigw-signature-v2:{API Gateway Signature}
        x-ncp-region_codeYES리전 코드 (KR)

        전체 채널 콜백 설정 요청 바디

        필드명필수 여부타입제약 사항설명
        callbackUrlYesStringcallback 을 받을 custom endpoint

        개별 채널 콜백 설정 요청 바디

        필드명필수 여부타입제약 사항설명
        callbackEndpointYesStringcallback 을 받을 custom endpoint

        응답

        전체 채널 콜백 설정 응답

        필드명타입설명비고
        callbackUrlString
        updateTimeInteger

        일반 채널 콜백 설정 응답

        필드명타입설명비고
        channelIdString
        channelNameString
        instanceNoString
        qualitySetIdInteger
        qualitySetNameString
        outputProtocolStringDefault set: HLS, DASH
        channelStatusStringCREATING, READY, PUBLISH, DELETED,BLOCK
        isRecordingBoolean
        useDvrBoolean
        immediateOnAirBoolean
        timemachineMinInteger단위: Minute
        snapshotObject
        snapshotIdInteger
        cdnObject
        cdn.instanceNoStringNO_CDN 이면 0
        cdn.serviceNameStringCDN Service NameNO_CDN 이면 ""
        cdn.profileIdIntegerGlobal Edge 의 프로필 IDNO_CDN 이면 0
        cdn.statusNameStringCDN 상태NO_CDN 이면 ""
        cdn.cdnTypeStringGLOBAL_CDN, GLOBAL_EDGE
        cdn.cdnDomainStringCDN DomainNO_CDN 이면 ""
        recordObject
        record.formatStringMP4,HLS,ALL
        record.typeStringNO_RECORD, AUTO_UPLOAD, MANUAL_UPLOAD
        record.bucketNameString
        record.filePathString
        record.accessControlStringPRIVATE, PUBLIC_READ
        publishUrlString
        streamKeyString
        recentPublishStartTimeInteger
        createdTimeInteger
        alertOnBooleanif alertOn == true, alertOptions should be set
        alertOptionsObject
        alertOptions.alertChangeStatusBoolean
        alertOptions.alertVodUploadFailBoolean
        alertOptions.alertReStreamFailBoolean
        totalPublishSecondsInteger
        envTypeStringDEV, STAGE, REAL
        callbackEndpointString

        리스트림 채널 콜백 설정 응답

        필드명타입설명비고
        channelIdString
        channelNameString
        instanceNoInteger
        channelStatusString
        createdTimeInteger
        publishUrlString
        streamKeyString
        planTypeStringSTANDARD, PROFESSIONAL
        restreamObject[]
        restream[].targetNameString
        restream[].rtmpUrlString
        restream[].streamKeyString
        restream[].idString설정되어 있으면 표시
        restream[].passwordString설정되어 있으면 표시
        platformCountInteger
        totalPublishSecondsInteger
        recentPublishStartTimeInteger
        alertOnBoolean
        alertOptionsObject
        alertOptions.alertChangeStatusBoolean
        alertOptions.alertVodUploadFailBoolean
        alertOptions.alertReStreamFailBoolean
        isPublishingBoolean
        envTypeStringDEV, STAGE, REAL
        callbackEndpointString

        예시

        전체 채널 콜백 설정 요청 예시

        POST /api/v2/events/callbackEndpoint
        HOST: livestation.apigw.ntruss.com
        Content-Type: application/json
        x-ncp-apigw-timestamp:1521787414578
        x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
        x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
        x-ncp-region_code:KR
        
        {
          "callbackUrl": "https://my-callback-endpoint"
          }
        HTTP

        전체 채널 콜백 설정 응답 예시

        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": {
              "callbackUrl": "https://my-callback-endpoint",
              "updateTime": 1614751615488
           }
        }
        HTTP

        일반 채널별 콜백 설정 요청 예시

        POST /api/v2/channels/{channelId}/callbackEndpoint
        HOST: livestation.apigw.ntruss.com
        Content-Type: application/json
        x-ncp-apigw-timestamp:1521787414578
        x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
        x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
        x-ncp-region_code:KR
        
        {
          "callbackEndpoint": "https://my-callback-endpoint"
        }
        HTTP

        일반 채널별 콜백 설정 응답 예시

        HTTP/1.1 200 OK
        Server: nginx
        Date: Fri, 26 Sep 2021 09:53:32 GMT
        Content-Type: application/json;charset=utf-8
        Connection: keep-alive
        Access-Control-Allow-Origin: *
        x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
        
        {
            "content" : {
                "channelId" : "ls-20200323114720-bMoDF",
                "channelName" : "mychannel",
                "instanceNo" : 1163899,
                "qualitySetId" : 6,
                "qualitySetName" : "360p-set",
                "outputProtocol" : "HLS, DASH",
                "channelStatus" : "READY",
                "isRecording" : false,
                "useDVR" : true,
                "immediateOnAir" : false,
                "timemachineMin" : 360,
                "cdn" : {
                    "instanceNo" : "1163900",
                    "serviceName" : "edge-ls-20200323114720-bMoDF",
                    "statusName" : "RUNNING",
                    "cdnType" : "GLOBAL_EDGE",
                    "cdnDomain" : "mycdn.edge.naverncp.com",
                     "profileId": 299,
                     "regionType": "KOREA"
                },
                "record": {
                    "type": "AUTO_UPLOAD",
                    "bucketName": "hls",
                    "filePath": "/livestation",
                    "format": "MP4",
                    "accessControl": "PRIVATE"
               },
                "publishUrl": "rtmp://live-station-rtmp-url",
                "streamKey": "jjiantco4psakuwd5526u2glcxrqaar4",
                "totalPublishSeconds" : 0,
                "createdTime" : 1584931640000,
                "recentPublishStartTime": 0,
                "alertOn" : false,
                "alertOptions" : {
                    "alertChangeStatus" : false,
                    "alertVodUploadFail" : false,
                    "alertReStreamFail" : false
                },
                "callbackEndpoint": "https://my-callback-endpoint",
                "envType": "REAL"
            }
        }
        HTTP

        리스트림 채널별 콜백 설정 요청 예시

        POST /api/v2/re-stream/channels/{channelId}/callbackEndpoint
        HOST: livestation.apigw.ntruss.com
        Content-Type: application/json
        x-ncp-apigw-timestamp:1521787414578
        x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
        x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
        x-ncp-region_code:KR
        
        {
          "callbackEndpoint": "https://my-callback-endpoint"
        }
        HTTP

        리스트림 채널별 콜백 설정 응답 예시

        HTTP/1.1 200 OK
        Server: nginx
        Date: Fri, 26 Feb 2021 09:53:32 GMT
        Content-Type: application/json;charset=utf-8
        Connection: keep-alive
        Access-Control-Allow-Origin: *
        x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
        
        {
          "content": {
            "channelId": "ls-20210225185132-FxGSn",
            "channelName": "mycallback-20210225185132",
            "instanceNo": 1627140,
            "channelStatus": "READY",
            "streamKey": "7xtotpxpkjnyhmjbe7k7jaa952q6lmhl",
            "publishUrl": "rtmp://live-station-rtmp-url",
            "planType": "STANDARD",
            "createdTime": 1614246692000,
            "restream": [
              {
                "id": "itis",
                "rtmpUrl": "rtmp://notworking-just-testcase.only",
                "streamKey": "12345",
                "password": "itispassword",
                "targetName": "YOUTUBE"
              }
            ],
            "platformCount": 1,
            "totalPublishSeconds": 0,
            "alertOn": false,
            "isPublishing": false,
            "alertOptions": {
              "alertChangeStatus": false,
              "alertVodUploadFail": false,
              "alertReStreamFail": false
            },
            "callbackEndpoint": "https://my-callback-endpoint",
            "envType": "REAL"
          }
        }
        HTTP

        VOD 채널별 콜백 설정 응답 예시

        {
          "content": {
            "channelId": "ls-20211122220557-mUv3r",
            "channelName": "mycallback-20211235185132",
            "instanceNo": 2043025,
            "qualitySetId": 4,
            "qualitySetName": "720p-set",
            "outputProtocol": "HLS",
            "status": "READY",
            "cdn": {
              "instanceNo": "1541959",
              "serviceName": "edge-ls-20201204112949-D7RTL",
              "statusName": "RUNNING",
              "cdnType": "GLOBAL_EDGE",
              "cdnDomain": "mycdn.edge.naverncp.ntruss.com",
              "profileId": 299,
              "regionType": "KOREA"
            },
            "totalPublishSeconds": 0,
            "createdTime": 1637586357000,
            "updatedTime": 1637587476000,
            "alertOn": false,
            "alertOptions": {
              "alertChangeStatus": false
            },
            "callbackEndpoint": "https://my-callback-endpoint",
            "envType": "REAL",
            "type": "VOD",
          }
        }
        Plain text

        이 문서가 도움이 되었습니까?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.