All URIs are relative to https://ws.api.video
Method | HTTP request | Description |
---|---|---|
Create | Post /webhooks | Create Webhook |
Get | Get /webhooks/{webhookId} | Retrieve Webhook details |
Delete | Delete /webhooks/{webhookId} | Delete a Webhook |
List | Get /webhooks | List all webhooks |
Create(webhooksCreationPayload WebhooksCreationPayload) (*Webhook, error)
CreateWithContext(ctx context.Context, webhooksCreationPayload WebhooksCreationPayload) (*Webhook, error)
Create Webhook
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("YOU_SANDBOX_API_KEY").Build()
webhooksCreationPayload := *apivideosdk.NewWebhooksCreationPayload([]string{"Events_example"}, "https://example.com/webhooks") // WebhooksCreationPayload |
res, err := client.Webhooks.Create(webhooksCreationPayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Create``: %v\n", err)
}
// response from `Create`: Webhook
fmt.Fprintf(os.Stdout, "Response from `Webhooks.Create`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
webhooksCreationPayload | WebhooksCreationPayload |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Get(webhookId string) (*Webhook, error)
GetWithContext(ctx context.Context, webhookId string) (*Webhook, error)
Retrieve Webhook details
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("YOU_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\n", err)
}
// response from `Get`: Webhook
fmt.Fprintf(os.Stdout, "Response from `Webhooks.Get`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | string | The unique webhook you wish to retreive details on. |
Name | Type | Description | Notes |
---|
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Delete(webhookId string) (error)
DeleteWithContext(ctx context.Context, webhookId string) (error)
Delete a Webhook
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("YOU_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\n", err)
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | string | The webhook you wish to delete. |
Name | Type | Description | Notes |
---|
(empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List(r WebhooksApiListRequest) (*WebhooksListResponse, error)
ListWithContext(ctx context.Context, r WebhooksApiListRequest) (*WebhooksListResponse, error)
List all webhooks
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("YOU_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\n", err)
}
// response from `List`: WebhooksListResponse
fmt.Fprintf(os.Stdout, "Response from `Webhooks.List`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
events | string | The webhook event that you wish to filter on. | |
currentPage | int32 | Choose the number of search results to return per page. Minimum value: 1 | [default to 1] |
pageSize | int32 | Results per page. Allowed values 1-100, default is 25. | [default to 25] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]