All URIs are relative to https://ws.api.video
Method | HTTP request | Description |
---|---|---|
Delete | Delete /videos/{videoId} | Delete a video |
Get | Get /videos/{videoId} | Show a video |
GetStatus | Get /videos/{videoId}/status | Show video status |
List | Get /videos | List all videos |
Update | Patch /videos/{videoId} | Update a video |
PickThumbnail | Patch /videos/{videoId}/thumbnail | Pick a thumbnail |
UploadWithUploadToken | Post /upload | Upload with an upload token |
Create | Post /videos | Create a video |
Upload | Post /videos/{videoId}/source | Upload a video |
UploadThumbnail | Post /videos/{videoId}/thumbnail | Upload a thumbnail |
Delete(videoId string) (error)
DeleteWithContext(ctx context.Context, videoId string) (error)
Delete a video
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The video ID for the video you want to delete.
err := client.Videos.Delete(videoId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Delete``: %v\n", err)
}
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The video ID for the video you want to delete. |
Name | Type | Description | Notes |
---|
(empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Get(videoId string) (*Video, error)
GetWithContext(ctx context.Context, videoId string) (*Video, error)
Show a video
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "videoId_example" // string | The unique identifier for the video you want details about.
res, err := client.Videos.Get(videoId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Get``: %v\n", err)
}
// response from `Get`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Get`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want details about. |
Name | Type | Description | Notes |
---|
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetStatus(videoId string) (*VideoStatus, error)
GetStatusWithContext(ctx context.Context, videoId string) (*VideoStatus, error)
Show video status
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The unique identifier for the video you want the status for.
res, err := client.Videos.GetStatus(videoId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.GetStatus``: %v\n", err)
}
// response from `GetStatus`: VideoStatus
fmt.Fprintf(os.Stdout, "Response from `Videos.GetStatus`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want the status for. |
Name | Type | Description | Notes |
---|
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List(r VideosApiListRequest) (*VideosListResponse, error)
ListWithContext(ctx context.Context, r VideosApiListRequest) (*VideosListResponse, error)
List all videos
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
req := apivideosdk.VideosApiListRequest{}
req.Title("My Video.mp4") // string | The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles.
req.Tags([]string{"Inner_example"}) // []string | A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned.
req.Metadata(map[string]string{"key": "TODO"}) // map[string]string | Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata) allows you to define a key that allows any value pair.
req.Description("New Zealand") // string | If you described a video with a term or sentence, you can add it here to return videos containing this string.
req.LiveStreamId("li400mYKSgQ6xs7taUeSaEKr") // string | If you know the ID for a live stream, you can retrieve the stream by adding the ID for it here.
req.SortBy("publishedAt") // string | Allowed: publishedAt, title. You can search by the time videos were published at, or by title.
req.SortOrder("asc") // string | Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A.
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.Videos.List(req)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.List``: %v\n", err)
}
// response from `List`: VideosListResponse
fmt.Fprintf(os.Stdout, "Response from `Videos.List`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
title | string | The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. | |
tags | []string | A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. | |
metadata | map[string] | Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. Dynamic Metadata allows you to define a key that allows any value pair. | |
description | string | If you described a video with a term or sentence, you can add it here to return videos containing this string. | |
liveStreamId | string | If you know the ID for a live stream, you can retrieve the stream by adding the ID for it here. | |
sortBy | string | Allowed: publishedAt, title. You can search by the time videos were published at, or by title. | |
sortOrder | string | Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. | |
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]
Update(videoId string, videoUpdatePayload VideoUpdatePayload) (*Video, error)
UpdateWithContext(ctx context.Context, videoId string, videoUpdatePayload VideoUpdatePayload) (*Video, error)
Update a video
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The video ID for the video you want to delete.
videoUpdatePayload := *apivideosdk.NewVideoUpdatePayload() // VideoUpdatePayload |
res, err := client.Videos.Update(videoId, videoUpdatePayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Update``: %v\n", err)
}
// response from `Update`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Update`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The video ID for the video you want to delete. |
Name | Type | Description | Notes |
---|---|---|---|
videoUpdatePayload | VideoUpdatePayload |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PickThumbnail(videoId string, videoThumbnailPickPayload VideoThumbnailPickPayload) (*Video, error)
PickThumbnailWithContext(ctx context.Context, videoId string, videoThumbnailPickPayload VideoThumbnailPickPayload) (*Video, error)
Pick a thumbnail
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | Unique identifier of the video you want to add a thumbnail to, where you use a section of your video as the thumbnail.
videoThumbnailPickPayload := *apivideosdk.NewVideoThumbnailPickPayload("Timecode_example") // VideoThumbnailPickPayload |
res, err := client.Videos.PickThumbnail(videoId, videoThumbnailPickPayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.PickThumbnail``: %v\n", err)
}
// response from `PickThumbnail`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.PickThumbnail`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | Unique identifier of the video you want to add a thumbnail to, where you use a section of your video as the thumbnail. |
Name | Type | Description | Notes |
---|---|---|---|
videoThumbnailPickPayload | VideoThumbnailPickPayload |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadWithUploadTokenFile(token string, file *os.File) (*Video, error) UploadWithUploadToken(token string, fileName string, fileReader io.Reader, fileSize int64) UploadWithUploadTokenFileWithContext(ctx context.Context, token string, file *os.File) (*Video, error) UploadWithUploadTokenWithContext(ctx context.Context, token string, fileName string, fileReader io.Reader, fileSize int64)
Upload with an upload token
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
token := "to1tcmSFHeYY5KzyhOqVKMKb" // string | The unique identifier for the token you want to use to upload a video.
file := os.NewFile(1234, "some_file") // *os.File | The path to the video you want to upload.
res, err := client.Videos.UploadWithUploadTokenFile(token, file)
// you can also use a Reader instead of a File:
// client.Videos.UploadWithUploadToken(token, fileName, fileReader, fileSize)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.UploadWithUploadToken``: %v\n", err)
}
// response from `UploadWithUploadToken`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.UploadWithUploadToken`: %v\n", res)
}
Progressive uploads make it possible to upload a video source "progressively," i.e., before knowing the total size of the video. This is done by sending chunks of the video source file sequentially. The last chunk is sent by calling a different method, so api.video knows that it is time to reassemble the different chunks that were received.
token := "to1tcmSFHeYY5KzyhOqVKMKb" // string | The unique identifier for the token you want to use to upload a video.
part1, err := os.Open("10m.mp4.part.a")
part2, err := os.Open("10m.mp4.part.b")
part3, err := os.Open("10m.mp4.part.c")
stream = client.Videos.CreateUploadWithUploadTokenStream(token, nil)
// or, if you want to upload to an existing video:
// stream = client.Videos.CreateUploadWithUploadTokenStream(token, videoId)
_, err = stream.UploadPartFile(part1)
_, err = stream.UploadPartFile(part2)
res, err := stream.UploadLastPartFile(part3)
err = part1.Close()
err = part2.Close()
err = part3.Close()
Name | Type | Description | Notes |
---|---|---|---|
token | string | The unique identifier for the token you want to use to upload a video. | |
file | *os.File | The path to the video you want to upload. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Create(videoCreationPayload VideoCreationPayload) (*Video, error)
CreateWithContext(ctx context.Context, videoCreationPayload VideoCreationPayload) (*Video, error)
Create a video
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoCreationPayload := *apivideosdk.NewVideoCreationPayload("Maths video") // VideoCreationPayload | video to create
res, err := client.Videos.Create(videoCreationPayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Create``: %v\n", err)
}
// response from `Create`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Create`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoCreationPayload | VideoCreationPayload | video to create |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadFile(videoId string, file *os.File) (*Video, error) Upload(videoId string, fileName string, fileReader io.Reader, fileSize int64) UploadFileWithContext(ctx context.Context, videoId string, file *os.File) (*Video, error) UploadWithContext(ctx context.Context, videoId string, fileName string, fileReader io.Reader, fileSize int64)
Upload a video
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | Enter the videoId you want to use to upload your video.
file := os.NewFile(1234, "some_file") // *os.File | The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\"/videos\\\" endpoint and add the \\\"source\\\" parameter when you create a new video.
res, err := client.Videos.UploadFile(videoId, file)
// you can also use a Reader instead of a File:
// client.Videos.Upload(videoId, fileName, fileReader, fileSize)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Upload``: %v\n", err)
}
// response from `Upload`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Upload`: %v\n", res)
}
Progressive uploads make it possible to upload a video source "progressively," i.e., before knowing the total size of the video. This is done by sending chunks of the video source file sequentially. The last chunk is sent by calling a different method, so api.video knows that it is time to reassemble the different chunks that were received.
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | Enter the videoId you want to use to upload your video.
part1, err := os.Open("10m.mp4.part.a")
part2, err := os.Open("10m.mp4.part.b")
part3, err := os.Open("10m.mp4.part.c")
stream = client.Videos.CreateUploadStream(videoId)
_, err = stream.UploadPartFile(part1)
_, err = stream.UploadPartFile(part2)
res, err := stream.UploadLastPartFile(part3)
err = part1.Close()
err = part2.Close()
err = part3.Close()
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | Enter the videoId you want to use to upload your video. |
Name | Type | Description | Notes |
---|---|---|---|
file | *os.File | The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \"/videos\" endpoint and add the \"source\" parameter when you create a new video. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadThumbnailFile(videoId string, file *os.File) (*Video, error) UploadThumbnail(videoId string, fileName string, fileReader io.Reader) UploadThumbnailFileWithContext(ctx context.Context, videoId string, file *os.File) (*Video, error) UploadThumbnailWithContext(ctx context.Context, videoId string, fileName string, fileReader io.Reader)
Upload a thumbnail
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()
videoId := "videoId_example" // string | Unique identifier of the chosen video
file := os.NewFile(1234, "some_file") // *os.File | The .jpg image to be added as a thumbnail.
res, err := client.Videos.UploadThumbnailFile(videoId, file)
// you can also use a Reader instead of a File:
// client.Videos.UploadThumbnail(videoId, fileName, fileReader)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.UploadThumbnail``: %v\n", err)
}
// response from `UploadThumbnail`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.UploadThumbnail`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | Unique identifier of the chosen video |
Name | Type | Description | Notes |
---|---|---|---|
file | *os.File | The .jpg image to be added as a thumbnail. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]