/watermarks
List all watermarks associated with your workspace.
sortBy
string
Allowed: createdAt. You can search by the time watermark were created at.
sortOrder
string
Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A.
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
pageSize
int
Results per page. Allowed values 1-100, default is 25.
// 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
Success
{
"data": [
{
"watermarkId": "watermark_1BWr2L5MTQwxGkuxKjzh6i",
"createdAt": "2019-12-16T08:25:51+00:00"
},
{
"watermarkId": "watermark_3BWC2L5MTQwxGkuxKjzh7g",
"createdAt": "2019-12-16T08:25:51+00:00"
}
],
"pagination": {
"currentPage": 1,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 11,
"currentPageItems": 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"
}
]
}
}
/watermarks
Create a new watermark by uploading a JPG
or a PNG
image.
file
file
required
The .jpg
or .png
image to be added as a watermark.
// 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)
}
Success
{
"watermarkId": "watermark_1BWr2L5MTQwxGkuxKjzh6i",
"createdAt": "2020-03-03T12:52:03+00:00"
}
/watermarks/{watermarkId}
Delete a watermark.
watermarkId
string
required
The watermark ID for the watermark you want to delete.
// 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);
No Content
Empty response
Was this page helpful?