MENU
      Register callback endpoint
        • PDF

        Register callback endpoint

        • PDF

        Article summary

        This is an API to register a callback endpoint that can receive events from Live Station.
        Callback endpoints can be used by separating callback settings for all channels and callback settings for individual channels.

        Callback delivery data

        If you register a callback endpoint, the following data is sent to the set endpoint URL whenever an event occurs in Live Station. (Using HTTP POST)

        Callback delivery response body

        Field nameRequiredTypeRestrictionsDescription
        idYesString
        logLevelYesString
        channelIdYesString
        eventYesString
        timestampYesString

        Callback delivery response example

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

        Request

        EndpointDescription
        [POST https://livestation.apigw.ntruss.com/api/v2/events/callbackEndpoint]Set up global channel callbacks (N (channels): 1 (callback endpoint))
        [POST https://livestation.apigw.ntruss.com/api/v2/channels/{channelId}/callbackEndpoint]Set up general channel-specific callbacks (1 (channel): 1 (callback endpoint))
        [POST https://livestation.apigw.ntruss.com/api/v2/re-stream/channels/{channelId}/callbackEndpoint]Set up restream channel-specific callbacks (1 (channel): 1 (callback endpoint))
        [POST https://livestation.apigw.ntruss.com/api/v2/vod/channels/{channelId}/callbackEndpoint]Set up VOD channel-specific callbacks (1 (channel): 1 (callback endpoint))

        Callback delivery action by request

        Callback endpoint by channelGlobal channel callback endpointAction
        Not setNot setNo callback sent
        Not setSetSend to global channel callback endpoint
        SetNot setSend to callback endpoints set up for specific channels
        SetSetSend to callback endpoints set up for specific channels

        Request headers

        Header nameRequiredDescription
        x-ncp-apigw-timestampYESIt indicates the elapsed time in milliseconds since January 1, 1970 00:00:00 UTC. Request is considered invalid if the timestamp differs from the current time by more than 5 minutes
        x-ncp-apigw-timestamp:{Timestamp}
        x-ncp-iam-access-keyYESAccess key ID value issued on NAVER Cloud Platform portal
        x-ncp-iam-access-key:{Sub Account Access Key}
        x-ncp-apigw-signature-v2YESSignature encrypted with the access key ID value and secret key
        x-ncp-apigw-signature-v2:{API Gateway Signature}
        x-ncp-region_codeYESRegion code (KR)

        Global channel callback setup request body

        Field nameRequiredTypeRestrictionsDescription
        callbackUrlYesStringcustom endpoint to receive callbacks

        Individual channel callback setup request body

        Field nameRequiredTypeRestrictionsDescription
        callbackEndpointYesStringcustom endpoint to receive callbacks

        Response

        Global channel callback setup response

        Field nameTypeDescriptionRemarks
        callbackUrlString
        updateTimeInteger

        General channel callback setup response

        Field nameTypeDescriptionRemarks
        channelIdString
        channelNameString
        instanceNoString
        qualitySetIdInteger
        qualitySetNameString
        outputProtocolStringDefault set: HLS, DASH
        channelStatusStringCREATING, READY, PUBLISH, DELETED,BLOCK
        isRecordingBoolean
        useDvrBoolean
        immediateOnAirBoolean
        timemachineMinIntegerUnit: Minute
        snapshotObject
        snapshotIdInteger
        cdnObject
        cdn.instanceNoString0 if NO_CDN
        cdn.serviceNameStringCDN Service Name"" if NO_CDN
        cdn.profileIdIntegerProfile ID of Global Edge0 if NO_CDN
        cdn.statusNameStringCDN status"" if NO_CDN
        cdn.cdnTypeStringGLOBAL_CDN, GLOBAL_EDGE
        cdn.cdnDomainStringCDN Domain"" if NO_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

        Restream channel callback setup response

        Field nameTypeDescriptionRemarks
        channelIdString
        channelNameString
        instanceNoInteger
        channelStatusString
        createdTimeInteger
        publishUrlString
        streamKeyString
        planTypeStringSTANDARD, PROFESSIONAL
        restreamObject[]
        restream[].targetNameString
        restream[].rtmpUrlString
        restream[].streamKeyString
        restream[].idStringDisplayed when set
        restream[].passwordStringDisplayed when set
        platformCountInteger
        totalPublishSecondsInteger
        recentPublishStartTimeInteger
        alertOnBoolean
        alertOptionsObject
        alertOptions.alertChangeStatusBoolean
        alertOptions.alertVodUploadFailBoolean
        alertOptions.alertReStreamFailBoolean
        isPublishingBoolean
        envTypeStringDEV, STAGE, REAL
        callbackEndpointString

        Examples

        Global channel callback setup request example

        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

        Global channel callback setup response example

        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

        General channel-specific callback setup request example

        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

        General channel-specific callback setup response example

        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

        Restream channel-specific callback setup request example

        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

        Restream channel-specific callback setup response example

        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 channel-specific callback setup response example

        {
          "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

        Was this article helpful?

        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.