Watermarks

Download Spec

List all watermarks

get /watermarks

List all watermarks associated with your workspace.

HTTP basic apiKey

sortBy

string

Allowed: createdAt. You can search by the time watermark were created at.

Example
"createdAt"

sortOrder

string

Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A.

Example
"asc"

currentPage

int

Choose the number of search results to return per page. Minimum value: 1

Default
1
Example
2

pageSize

int

Results per page. Allowed values 1-100, default is 25.

Default
25
Example
30

Request

// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WatermarksApi.md#list

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" }); 

// retrieve the first page of all watermarks
const watermarks = await client.watermarks.list({});

// retrieve the 5 first watermarks, ordered by creation date
const watermarks2 = await client.watermarks.list({});
createdAt
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WatermarksApi.md#list
// 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/WatermarksApi.md#list
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WatermarksApi.md#list
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/WatermarksApi.md#list

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

// retrieve the first page of all watermarks
$watermarks =  client->watermarks()->list();

// retrieve the 5 first watermarks, ordered by creation date
$watermarks2 = $client->watermarks()->list(array(
    'pageSize' => 5,
    'sortBy' => 'createdAt',
    'sortOrder' => 'asc'
)); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WatermarksApi.md#list
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WatermarksAPI.md#list

Response

Examples Schema

Success

{
  "data": [
    {
      "createdAt": "2019-12-16T08:25:51.000Z",
      "watermarkId": "watermark_1BWr2L5MTQwxGkuxKjzh6i"
    },
    {
      "createdAt": "2019-12-16T08:25:51.000Z",
      "watermarkId": "watermark_3BWC2L5MTQwxGkuxKjzh7g"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 11,
    "itemsTotal": 11,
    "links": [
      {
        "rel": "self",
        "uri": "https://ws.api.video/watermarks?currentPage=1"
      },
      {
        "rel": "first",
        "uri": "https://ws.api.video/watermarks?currentPage=1"
      },
      {
        "rel": "last",
        "uri": "https://ws.api.video/watermarks?currentPage=1"
      }
    ],
    "pageSize": 25,
    "pagesTotal": 1
  }
}

Bad Request

{
  "name": "page",
  "problems": [
    {
      "name": "page",
      "range": {
        "min": 1
      },
      "title": "This parameter is out of the allowed range of values."
    },
    {
      "name": "pageSize",
      "range": {
        "max": 100,
        "min": 10
      },
      "title": "This parameter is out of the allowed range of values."
    }
  ],
  "range": {
    "min": 1
  },
  "status": 400,
  "title": "This parameter is out of the allowed range of values."
}

data

array[object (Watermark)]

required

Watermark

object (Watermark)

createdAt

string

date-time

When the watermark was created, presented in ISO-8601 format.

Example
"2019-06-24T11:45:01.109+00"

watermarkId

string

The unique identifier of the watermark.

Example
"watermark_1BWr2L5MTQwxGkuxKjzh6i"

pagination

object (pagination)

required

Example
{ "currentPage": 3, "currentPageItems": 20, "itemsTotal": 123, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" } }, "pageSize": 20, "pagesTotal": 7 }

currentPage

int

The current page index.

currentPageItems

int

The number of items on the current page.

itemsTotal

int

Total number of items that exist.

links

array[object (PaginationLink)]

required

PaginationLink

object (PaginationLink)

rel

string

uri

string

uri

pageSize

int

Maximum number of item per page.

pagesTotal

int

Number of items listed in the current page.

name

string

The name of the parameter that caused the error.

problems

array[object (BadRequest)]

Returns any additional problems in the request in an array of objects.

BadRequest

object (BadRequest)

name

string

The name of the parameter that caused the error.

status

int

The HTTP status code.

title

string

A description of the error that occurred.

type

string

A link to the error documentation.

status

int

The HTTP status code.

title

string

A description of the error that occurred.

type

string

A link to the error documentation.

Upload a watermark

post /watermarks

Create a new watermark by uploading a JPG or a PNG image.

HTTP basic apiKey

file

string

binary

required

The .jpg or .png image to be added as a watermark.

Request

// 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/WatermarksApi.md#upload

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()

    file, _ := os.Open("./watermark.jpg")
    
    res, err := client.Watermarks.UploadFile(file)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Watermarks.UploadFile``: %v", err)
    }
    // response from `UploadFile`: Watermark
    fmt.Fprintf(os.Stdout, "Response from `Watermarks.UploadFile`: %v", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WatermarksApi.md#upload

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

// Upload a watermark
const watermark = await client.watermarks.upload('test/data/test.jpg');

// create a video with watermark
const watermarkVideo = await client.videos.create({
  title: 'Nodejs - watermark',
  watermark: {
    id: watermark.watermarkId,
    top: '0px',
    left: '0px',
    width: '100px',
    height: '100px',
  },
});
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/WatermarksApi.md#upload

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
);

// upload the watermark
$watermark = $client->watermarks()->upload(new SplFileObject(__DIR__ . '/watermark.png'));

// create a new video with the watermark
$video = $client->videos()->create((new VideoCreationPayload())
        ->setWatermark((new VideoWatermark())
                ->setId($watermark->getWatermarkId())
                ->setTop("0px")
                ->setLeft("0px")
                ->setWidth("100px")
                ->setHeight("100px"))
        ->setTitle("Test PHP watermark")
);

// upload the video
$client->videos()->upload($video->getVideoId(), new SplFileObject(__DIR__ . '/558k.mp4')); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WatermarksApi.md#upload

import apivideo
from apivideo.api import videos_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = videos_api.WatermarksApi(api_client)
    file = open('/path/to/file', 'rb') # file_type | The watermark image.

    # example passing only required values which don't have defaults set
    try:
        # Upload a watermark
        api_response = api_instance.upload(file)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling WatermarksApi->upload: %s\
" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WatermarksApi.md#upload

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.WatermarksApi;
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", ApiVideoClient.Environment.SANDBOX);

   WatermarksApi watermarkApi = apiClient.watermarks();

   File file = new File("/path/to/file"); // The watermark image.

   try {
     Watermark result = watermarkApi.upload(file);
     System.out.println(result);
   } catch (ApiException e) {
     System.err.println("Exception when calling WatermarksApi#upload");
     System.err.println("Status code: " + e.getCode());
     System.err.println("Reason: " + e.getMessage());
     System.err.println("Response headers: " + e.getResponseHeaders());
     e.printStackTrace();
   }
 }
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WatermarksApi.md#upload

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class uploadWatermarkExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var file = File.OpenRead("watermark.jpg");  // The watermark image.
            var apiWatermarksInstance = apiInstance.Watermarks();

            try
            {
                // Upload a watermark
                Video result = apiWatermarksInstance.upload(videoId, file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WatermarksApi.upload: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WatermarksAPI.md#upload

Response

Examples Schema

Success

{
  "createdAt": "2020-03-03T12:52:03.085Z",
  "watermarkId": "watermark_1BWr2L5MTQwxGkuxKjzh6i"
}

Bad Request

{
  "name": "file",
  "status": 400,
  "title": "Only [jpeg, jpg, JPG, JPEG, png, PNG] extensions are supported.",
  "type": "https://docs.api.video/docs/fileextension"
}

createdAt

string

date-time

When the watermark was created, presented in ISO-8601 format.

Example
"2019-06-24T11:45:01.109+00"

watermarkId

string

The unique identifier of the watermark.

Example
"watermark_1BWr2L5MTQwxGkuxKjzh6i"

name

string

The name of the parameter that caused the error.

problems

array[object (BadRequest)]

Returns any additional problems in the request in an array of objects.

BadRequest

object (BadRequest)

name

string

The name of the parameter that caused the error.

status

int

The HTTP status code.

title

string

A description of the error that occurred.

type

string

A link to the error documentation.

status

int

The HTTP status code.

title

string

A description of the error that occurred.

type

string

A link to the error documentation.

Delete a watermark

delete /watermarks/{watermarkId}

Delete a watermark.

HTTP basic apiKey

watermarkId

string

required

The watermark ID for the watermark you want to delete.

Example
"watermark_1BWr2L5MTQwxGkuxKjzh6i"

Request

// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WatermarksApi.md#delete

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" }); 

const watermarkId = 'watermark_1Bji68oeAAwR44dAb5ZhML'; // The watermark ID for the watermark you want to delete.

client.watermarks.delete(watermarkId);
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WatermarksApi.md#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/WatermarksApi.md#delete
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WatermarksApi.md#delete
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/WatermarksApi.md#list

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$watermarkId = 'watermark_1Bji68oeAAwR44dAb5ZhML'; // The watermark ID for the watermark you want to delete.

$client->watermarks->delete(watermarkId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WatermarksApi.md#delete
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WatermarksAPI.md#delete

Response

Examples Schema

No Content

Empty response

Not Found

{
  "name": "watermarkId",
  "status": 404,
  "title": "The requested resource was not found.",
  "type": "https://docs.api.video/docs/resourcenot_found"
}

No schema

name

string

status

int

title

string

type

string

Was this page helpful?