Callback Endpoint 등록

Prev Next

Classic/VPC 환경에서 이용 가능합니다.

전체 채널의 이벤트를 수신할 수 있는 기본 콜백 엔드포인트를 등록합니다.

콜백 발송 데이터

콜백 엔드포인트 등록 시 이벤트가 발생할 때마다 지정된 엔드포인트 URL로 데이터가 전송됩니다. 데이터 전송에는 HTTP POST 메서드를 사용합니다. 발송 데이터에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
id Integer Required 이벤트 식별자
logLevel String Required 로그 레벨
channelId String Required 채널 아이디
event String Required 이벤트 코드
timestamp Integer Required 이벤트 발생 일시(밀리초)
  • Unix Timestamp 형식

발송 데이터 예시는 다음과 같습니다.

{
    "id": 1234,
    "logLevel": "INFO",
    "channelId": "ls-20200327******-aBCD3",
    "event": "STREAM_UPDATE",
    "timestamp": 1599218791425
}
참고

콜백 발송 동작은 다음과 같이 결정됩니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

메서드 URI
POST /api/v2/events/callbackEndpoint

요청 헤더

Live Station API에서 공통으로 사용하는 헤더에 대한 정보는 Live Station 요청 헤더를 참조해 주십시오.

요청 바디

요청 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
callbackUrl String Required 콜백 엔드포인트 URL

요청 예시

요청 예시는 다음과 같습니다.

curl --location --request POST 'https://livestation.apigw.ntruss.com/api/v2/events/callbackEndpoint' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'x-ncp-region_code: KR' \
--header 'Content-Type: application/json' \
--data '{
    "callbackUrl": "https://www.callback-endpoint.com"
}'

응답

응답 형식을 설명합니다.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
content Object - 응답 결과
content.callbackUrl String - 콜백 엔드포인트 URL
content.updateTime Integer - 업데이트 일시(밀리초)
  • Unix Timestamp 형식

응답 상태 코드

Live Station API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Live Station 응답 상태 코드를 참조해 주십시오.

응답 예시

응답 예시는 다음과 같습니다.

{
    "content": {
        "callbackUrl": "https://www.callback-endpoint.com",
        "updateTime": 1755750398046
    }
}