All URIs are relative to https://ws.api.video
Method | HTTP request | Description |
---|---|---|
Upload | Post /videos/{videoId}/chapters/{language} | Upload a chapter |
Get | Get /videos/{videoId}/chapters/{language} | Retrieve a chapter |
Delete | Delete /videos/{videoId}/chapters/{language} | Delete a chapter |
List | Get /videos/{videoId}/chapters | List video chapters |
UploadFile(videoId string, language string, file *os.File) (*Chapter, error) Upload(videoId string, language string, fileName string, fileReader io.Reader) UploadFileWithContext(ctx context.Context, videoId string, language string, file *os.File) (*Chapter, error) UploadWithContext(ctx context.Context, videoId string, language string, fileName string, fileReader io.Reader)
Upload a chapter
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()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The unique identifier for the video you want to upload a chapter for.
language := "en" // string | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
file := os.NewFile(1234, "some_file") // *os.File | The VTT file describing the chapters you want to upload.
res, err := client.Chapters.UploadFile(videoId, language, file)
// you can also use a Reader instead of a File:
// client.Chapters.Upload(videoId, language, fileName, fileReader)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Chapters.Upload``: %v\n", err)
}
// response from `Upload`: Chapter
fmt.Fprintf(os.Stdout, "Response from `Chapters.Upload`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want to upload a chapter for. | |
language | string | A valid BCP 47 language representation. |
Name | Type | Description | Notes |
---|---|---|---|
file | *os.File | The VTT file describing the chapters you want to upload. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Get(videoId string, language string) (*Chapter, error)
GetWithContext(ctx context.Context, videoId string, language string) (*Chapter, error)
Retrieve a chapter
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()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The unique identifier for the video you want to show a chapter for.
language := "en" // string | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
res, err := client.Chapters.Get(videoId, language)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Chapters.Get``: %v\n", err)
}
// response from `Get`: Chapter
fmt.Fprintf(os.Stdout, "Response from `Chapters.Get`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want to show a chapter for. | |
language | string | A valid BCP 47 language representation. |
Name | Type | Description | Notes |
---|
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Delete(videoId string, language string) (error)
DeleteWithContext(ctx context.Context, videoId string, language string) (error)
Delete a chapter
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()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The unique identifier for the video you want to delete a chapter from.
language := "en" // string | A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
err := client.Chapters.Delete(videoId, language)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Chapters.Delete``: %v\n", err)
}
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want to delete a chapter from. | |
language | string | A valid BCP 47 language representation. |
Name | Type | Description | Notes |
---|
(empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List(videoId string, r ChaptersApiListRequest) (*ChaptersListResponse, error)
ListWithContext(ctx context.Context, videoId string, r ChaptersApiListRequest) (*ChaptersListResponse, error)
List video chapters
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.ChaptersApiListRequest{}
req.VideoId("vi4k0jvEUuaTdRAEjQ4Jfrgz") // string | The unique identifier for the video you want to retrieve a list of chapters for.
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.Chapters.List(videoId string, req)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Chapters.List``: %v\n", err)
}
// response from `List`: ChaptersListResponse
fmt.Fprintf(os.Stdout, "Response from `Chapters.List`: %v\n", res)
}
Name | Type | Description | Notes |
---|---|---|---|
videoId | string | The unique identifier for the video you want to retrieve a list of chapters for. |
Name | Type | Description | Notes |
---|---|---|---|
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]