/webhooksRetrieve a list of all webhooks configured for the current workspace.
eventsstringThe webhook event that you wish to filter on.
currentPageintChoose the number of search results to return per page. Minimum value: 1
pageSizeintResults per page. Allowed values 1-100, default is 25.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#list
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
req := apivideosdk.WebhooksApiListRequest{}
req.Events("video.encoding.quality.completed") // string | The webhook event that you wish to filter on.
req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)
res, err := client.Webhooks.List(req)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.List``: %v\
", err)
}
// response from `List`: WebhooksListResponse
fmt.Fprintf(os.Stdout, "Response from `Webhooks.List`: %v\
", res)
}
Success
{
"data": [
{
"webhookId": "webhook_XXXXXXXXXXXXXXX",
"createdAt": "2021-01-08T14:12:18+00:00",
"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": 2,
"currentPageItems": 2,
"links": [
{
"rel": "self",
"uri": "https://ws.api.video/webhooks?currentPage=1"
},
{
"rel": "first",
"uri": "https://ws.api.video/webhooks?currentPage=1"
},
{
"rel": "last",
"uri": "https://ws.api.video/webhooks?currentPage=1"
}
]
}
}/webhooksWebhooks can push notifications to your server, rather than polling api.video for changes. We currently offer four events:
video.encoding.quality.completed Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like { "type": "video.encoding.quality.completed", "emittedAt": "2021-01-29T16:46:25.217+01:00", "videoId": "viXXXXXXXX", "encoding": "hls", "quality": "720p"} . This request says that the 720p HLS encoding was completed.live-stream.broadcast.started When a live stream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires.live-stream.broadcast.ended This event fires when a live stream has finished broadcasting.video.source.recorded This event occurs when a live stream is recorded and submitted for encoding.video.caption.generated This event occurs when an automatic caption has been generated.video.summary.generated This event occurs when an automatic summary has been generated.eventsarrayrequired
An array of webhook events that you want to subscribe to.
urlstringrequired
The the url to which HTTP notifications are sent. It could be any http or https URL.
{
"events": [
"video.encoding.quality.completed"
],
"url": "http://clientnotificationserver.com/notif?myquery=query"
}Created
{
"webhookId": "webhook_XXXXXXXXXXXXXXX",
"createdAt": "2021-01-08T14:12:18+00:00",
"events": [
"video.encoding.quality.completed"
],
"url": "http://clientnotificationserver.com/notif?myquery=query"
}/webhooks/{webhookId}Retrieve webhook details by id.
webhookIdstringrequired
The unique webhook you wish to retreive details on.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#get
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
webhookId := "webhookId_example" // string | The unique webhook you wish to retreive details on.
res, err := client.Webhooks.Get(webhookId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Get``: %v\
", err)
}
// response from `Get`: Webhook
fmt.Fprintf(os.Stdout, "Response from `Webhooks.Get`: %v\
", res)
}
Success
{
"webhookId": "webhook_XXXXXXXXXXXXXXX",
"createdAt": "2021-01-08T14:12:18+00:00",
"events": [
"video.encoding.quality.completed"
],
"url": "http://clientnotificationserver.com/notif?myquery=query"
}/webhooks/{webhookId}This endpoint will delete the indicated webhook.
webhookIdstringrequired
The webhook you wish to delete.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#delete
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
webhookId := "webhookId_example" // string | The webhook you wish to delete.
err := client.Webhooks.Delete(webhookId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Delete``: %v\
", err)
}
}
No Content
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
liveStreamIdstringThe ID of the live stream that started broadcasting.
{
"type": "live-stream.broadcast.started",
"emittedAt": "2024-08-151T10:18:47+00:00",
"liveStreamId": "li400mYKSgQ6xs7taUeSaEap"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
liveStreamIdstringThe ID of the live stream that ended broadcasting.
{
"type": "live-stream.broadcast.ended",
"emittedAt": "2024-08-151T10:18:47+00:00",
"liveStreamId": "li400mYKSgQ6xs7taUeSaEap"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
liveStreamIdstringThe ID of the live stream that ended broadcasting.
videoIdstringThe video ID of the live stream recording.
{
"type": "video.source.recorded",
"emittedAt": "2024-08-151T10:18:47+00:00",
"liveStreamId": "li400mYKSgQ6xs7taUeSaEap",
"videoId": "vi4blUQJFrYWbaG44NChkH11"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
videoIdstringThe ID of the video where a certain quality version's encoding is finished.
encodingstringThe type of encoding that is finished.
qualitystringThe quality version of encoding that is finished.
{
"type": "video.encoding.quality.completed",
"emittedAt": "2024-08-151T10:18:47+00:00",
"videoId": "vi4blUQJFrYWbaG44NChkH11",
"encoding": "hls",
"quality": "1080p"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
videoIdstringThe ID of the video for which the caption was generated.
captionIdstringThe ID of the caption that was generated.
generationModestringReturns the method used to generate the caption. transcript means that the caption was generated based on the transcription of the video. Learn more about transcripts here.
languagestringReturns the language of the captions in IETF language tag format.
{
"type": "video.caption.generated",
"emittedAt": "2024-08-151T10:18:47+00:00",
"videoId": "vi4blUQJFrYWbaG44NCh1234",
"captionId": "caption_1CHAfLFHT5B5EV4vzT1234",
"generationMode": "transcript",
"language": "en"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
typestringThe name of the webhook event that occurred.
emittedAtstringReturns the date-time when the webhook event occurred.
videoIdstringThe ID of the video for which the summary was generated.
summaryIdstringThe ID of the summary that was generated.
{
"type": "video.summary.generated",
"emittedAt": "2024-08-151T10:18:47+00:00",
"videoId": "vi4blUQJFrYWbaG44NCh1234",
"summaryId": "summary_1CGyYoB9XCgBk4iQna8ocT"
}Your webhook server may return this response to api.video to signal that the webhook is accepted.
Empty response
Was this page helpful?