Skip to content

Latest commit

 

History

History
307 lines (231 loc) · 13.5 KB

ChaptersApi.md

File metadata and controls

307 lines (231 loc) · 13.5 KB

ChaptersApi

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

upload

Chapter upload(videoId, language, file) okhttp3.Call uploadAsync(videoId, language, file, callback) ApiResponse uploadWithHttpInfo(videoId, language, file)

Upload a chapter

Upload a VTT file to add chapters to your video. Chapters help break the video into sections. Read our tutorial for more details.

Example

// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.ChaptersApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    ChaptersApi apiInstance = client.chapters();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to upload a chapter for.
    String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
    File file = new File("/path/to/file"); // The VTT file describing the chapters you want to upload.

    try {
      Chapter result = apiInstance.upload(videoId, language, file);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChaptersApi#upload");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.
file File The VTT file describing the chapters you want to upload.

Return type

Chapter

Authorization

API key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
400 Bad Request * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

get

Chapter get(videoId, language) okhttp3.Call getAsync(videoId, language, callback) ApiResponse getWithHttpInfo(videoId, language)

Retrieve a chapter

Retrieve a chapter for by video id in a specific language.

Example

// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.ChaptersApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    ChaptersApi apiInstance = client.chapters();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to show a chapter for.
    String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.

    try {
      Chapter result = apiInstance.get(videoId, language);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChaptersApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.

Return type

Chapter

Authorization

API key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

delete

delete(videoId, language) okhttp3.Call deleteAsync(videoId, language, callback) ApiResponse deleteWithHttpInfo(videoId, language)

Delete a chapter

Delete a chapter in a specific language by providing the video ID for the video you want to delete the chapter from and the language the chapter is in.

Example

// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.ChaptersApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    ChaptersApi apiInstance = client.chapters();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to delete a chapter from.
    String language = "en"; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.

    try {
      apiInstance.delete(videoId, language);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChaptersApi#delete");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.

Return type

null (empty response body)

Authorization

API key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No Content * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

list

ChaptersListResponse list(videoId).currentPage(currentPage).pageSize(pageSize).execute() okhttp3.Call executeAsync(callback) ApiResponse executeWithHttpInfo()

List video chapters

Retrieve a list of all chapters for by video id.

Example

// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.ChaptersApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    ChaptersApi apiInstance = client.chapters();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique identifier for the video you want to retrieve a list of chapters for.
    Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
    Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

    try {
      Page<Chapter> result = apiInstance.list(videoId)
            .currentPage(currentPage)
            .pageSize(pageSize)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChaptersApi#list");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
videoId String The unique identifier for the video you want to retrieve a list of chapters for.
currentPage Integer Choose the number of search results to return per page. Minimum value: 1 [optional] [default to 1]
pageSize Integer Results per page. Allowed values 1-100, default is 25. [optional] [default to 25]

Return type

Page<Chapter>

Authorization

API key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.