Skip to content

Commit

Permalink
Merge pull request #401 from apivideo/add-webhook-signatures
Browse files Browse the repository at this point in the history
Add webhook signatures to documentation
  • Loading branch information
szekelyzol authored Sep 26, 2024
2 parents cb866fb + 88f0535 commit 2afddfe
Show file tree
Hide file tree
Showing 2 changed files with 431 additions and 415 deletions.
207 changes: 200 additions & 7 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13385,17 +13385,19 @@ paths:
events:
- video.encoding.quality.completed
url: 'http://clientnotificationserver.com/notif?myquery=query'
signatureSecret: 'sig_sec_Abcd12348RLP7VPLi7nYVh'
- webhookId: webhook_XXXXXXXXXYYYYYY
createdAt: '2021-01-12T12:12:12+00:00'
events:
- video.encoding.quality.completed
url: 'http://clientnotificationserver.com/notif?myquery=query2'
signatureSecret: 'sig_sec_Abcd12358RLP7VPLi7nYVy'
pagination:
currentPage: 1
pageSize: 25
pagesTotal: 1
itemsTotal: 11
currentPageItems: 11
itemsTotal: 2
currentPageItems: 2
links:
- rel: self
uri: 'https://ws.api.video/webhooks?currentPage=1'
Expand Down Expand Up @@ -13648,6 +13650,7 @@ paths:
events:
- video.encoding.quality.completed
url: 'http://clientnotificationserver.com/notif?myquery=query'
signatureSecret: 'sig_sec_Abcd12348RLP7VPLi7nYVh'
'400':
headers:
X-RateLimit-Limit:
Expand Down Expand Up @@ -14982,23 +14985,26 @@ components:
properties:
webhookId:
type: string
description: Unique identifier of the webhook
description: A unique identifier of the webhook you subscribed to.
example: webhook_XXXXXXXXXXXXXXX
createdAt:
type: string
description: 'When an webhook was created, presented in ATOM UTC format.'
description: 'The time and date when you created this webhook subscription, in ATOM UTC format.'
format: date-time
example: '2019-06-24T11:45:01+00:00'
events:
type: array
description: A list of events that will trigger the webhook.
description: A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided.
example: '["video.encoding.quality.completed"]'
items:
type: string
url:
type: string
description: URL of the webhook
description: The URL where the API sends the webhook.
example: 'http://clientnotificationserver.com/notif?myquery=query'
signatureSecret:
type: string
description: A secret key for the webhook you subscribed to. You can use it to verify the origin of the webhook call that you receive.
video-status:
title: VideoStatus
type: object
Expand Down Expand Up @@ -16220,4 +16226,191 @@ x-doctave:
- go
- node
- php
- python
- python
x-webhooks:
live-stream.broadcast.started:
post:
tags:
- Webhooks
summary: Live stream started
description: This webhook triggers when a live stream broadcast is started.
operationId: POST-webhooks
parameters:
- in: header
name: X-Api-Video-WebhookID
schema:
type: string
description: The unique ID of your webhook.
required: true
- in: header
name: X-Api-Video-Signature
schema:
type: string
description: The webhook's body encrypted using the webhook's signature secret, in HMAC SHA256. Use this hash to verify that api.video is the origin of this webhook notification.
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
description: The name of the webhook event that occured.
example: live-stream.broadcast.started
emittedAt:
description: Returns the date-time when the webhook event occurred.
type: string
format: date-time
example: '2024-08-151T10:18:47+00:00'
liveStreamId:
description: The ID of the live stream that started broadcasting.
type: string
example: li400mYKSgQ6xs7taUeSaEap
responses:
'202':
summary: Accepted
description: Your webhook server may return this response to api.video to signal that the webhook is accepted.
live-stream.broadcast.ended:
post:
tags:
- Webhooks
summary: Live stream ended
description: This webhook triggers when a live stream broadcast is ended.
operationId: POST-webhooks
parameters:
- in: header
name: X-Api-Video-WebhookID
schema:
type: string
description: The unique ID of your webhook.
required: true
- in: header
name: X-Api-Video-Signature
schema:
type: string
description: The webhook's body encrypted using the webhook's signature secret, in HMAC SHA256. Use this hash to verify that api.video is the origin of this webhook notification.
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
description: The name of the webhook event that occured.
example: live-stream.broadcast.ended
emittedAt:
description: Returns the date-time when the webhook event occurred.
type: string
format: date-time
example: '2024-08-151T10:18:47+00:00'
liveStreamId:
description: The ID of the live stream that ended broadcasting.
type: string
example: li400mYKSgQ6xs7taUeSaEap
responses:
'202':
summary: Accepted
description: Your webhook server may return this response to api.video to signal that the webhook is accepted.
video.source.recorded:
post:
tags:
- Webhooks
summary: Video source recorded
description: This webhook triggers when a live stream broadcast is completed and the recording of the stream is ready for transcoding. This means that the video is in queue for transcoding.
operationId: POST-webhooks
parameters:
- in: header
name: X-Api-Video-WebhookID
schema:
type: string
description: The unique ID of your webhook.
required: true
- in: header
name: X-Api-Video-Signature
schema:
type: string
description: The webhook's body encrypted using the webhook's signature secret, in HMAC SHA256. Use this hash to verify that api.video is the origin of this webhook notification.
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
description: The name of the webhook event that occured.
example: video.source.recorded
emittedAt:
description: Returns the date-time when the webhook event occurred.
type: string
format: date-time
example: '2024-08-151T10:18:47+00:00'
liveStreamId:
description: The ID of the live stream that ended broadcasting.
type: string
example: li400mYKSgQ6xs7taUeSaEap
videoId:
description: The video ID of the live stream recording.
type: string
example: vi4blUQJFrYWbaG44NChkH11
responses:
'202':
summary: Accepted
description: Your webhook server may return this response to api.video to signal that the webhook is accepted.
video.encoding.quality.completed:
post:
tags:
- Webhooks
summary: Video encoding completed
description: This webhook triggers when a new video is uploaded into your account, and all HLS and mp4 quality versions are encoded.
operationId: POST-webhooks
parameters:
- in: header
name: X-Api-Video-WebhookID
schema:
type: string
description: The unique ID of your webhook.
required: true
- in: header
name: X-Api-Video-Signature
schema:
type: string
description: The webhook's body encrypted using the webhook's signature secret, in HMAC SHA256. Use this hash to verify that api.video is the origin of this webhook notification.
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
description: The name of the webhook event that occured.
example: video.encoding.quality.completed
emittedAt:
description: Returns the date-time when the webhook event occurred.
type: string
format: date-time
example: '2024-08-151T10:18:47+00:00'
videoId:
description: The ID of the video where a certain quality version's encoding is finished.
type: string
example: vi4blUQJFrYWbaG44NChkH11
encoding:
description: The type of encoding that is finished.
type: string
enum: [hls, mp4]
example: hls
quality:
description: The quality version of encoding that is finished.
type: string
enum: [240p, 360p, 480p, 720p, 1080p]
example: 1080p
responses:
'202':
summary: Accepted
description: Your webhook server may return this response to api.video to signal that the webhook is accepted.
Loading

0 comments on commit 2afddfe

Please sign in to comment.