Player Template API

1. Login

To log in - the general login API is used. Example - Reporting API | Login API


2. Logout

To log out - the general logout API is used. Example - Reporting API | Logout API


3. Player Template entity API

3.1. Get Template List

Retrieves a list of all templates.

Request URL:
https://manage.aniview.com/api/taggenerator/player-template?format=json&expand=null&filter={"$and":[{"status":{"$in":[1]}}]}&includeGlobal=true

Request Method:
GET

Status Code:
200 OK

Filtering Parameters (Optional):

Parameter

Description

Values

Parameter

Description

Values

status

Status of template

Active:1, Archived:2

includeGlobal

Include default templates

Boolean

type

Type of template

Outstream:1, Instream:2

 


3.2. Create Template

Request URL:
Request URL:

https://manage.aniview.com/api/taggenerator/player-template?format=json

Request Method:
POST

3.2.1 Create Outstream Template

Outseam template is created for player tags that play only ads without content.

The template allows customizing the player’s appearance and functionality. A single template can be set to service multiple channels. The connection between the channel and template is done under the tag entity.

Request Example payload:

Minimal Request Example Payload :

{ "type": 1, "name": "api_example_min", "description": "", "staging": { "performance": { "autoPlay": true, "loop": true, "autoContinue": true }, "content": { "type": 0 }, "appearance": { "playerMode": 0 }, "controls": { "timelineMode": "bottom", "closeButtonStyle": { "position": 0 }, "pauseButton": true, "soundButton": true, "showVolumeControl": true, "volumeControlVertical": true, "showFullScreen": true, "showDuration": true, "showPrevButton": true, "showNextButton": true, "showBigPrevNext": true, "showBigPrevNextOnPause": true, "showBigPlay": true, "showPauseButton": true, "showBigPlayOnPause": true, "showReplay": true }, "logo": { "logo": true, "customLogo": {} }, "mobile": {}, "advanced": {}, "extensions": { "isActive": true, "preloader": { "type": 0, "clickThrough": null } } } }

Full Inread Request Example Payload :

{ "type": 1, "name": "api_template_max", "description": "Description", "staging": { "performance": { "autoPlay": true, "loop": true, "autoContinue": true, "vastRetry": 1, "errorLimit": 2, "maxImp": 3, "maxRun": 4, "midrolltime": 5, "pauseOnUnseen": true, "pauseOnBlur": true, "reqOnView": true, "tabInView": true, "startOnView": true, "playOnView": true, "playOnViewPerc": 50 }, "content": { "type": 0 }, "appearance": { "playerMode": 0, "adLabel": { "text": "-Advertising Label-" }, "maxWidth": 100, "minHeight": 100, "maxzindex": 9999, "openAnim": true, "showPlayer": true, "customcss": "#custom_css{}" }, "controls": { "timelineMode": "bottom", "closeButtonStyle": { "position": 1, "outside": true, "right": 10, "overlayMargin": 15 }, "pauseButton": true, "soundButton": true, "showVolumeControl": true, "volumeControlVertical": true, "showFullScreen": true, "showDuration": true, "showPrevButton": true, "showNextButton": true, "showBigPrevNext": true, "showBigPrevNextOnPause": true, "showBigPlay": true, "showPauseButton": true, "showBigPlayOnPause": true, "showReplay": true, "skip": true, "skipTimer": 5, "skipText": "Skip Text", "closeButton": true }, "logo": { "logo": true, "customLogo": { "customLogoEnabled": true, "text": "Ads by network", "link": "https://www.aniview.com/wp-content/uploads/2021/03/Aniview-Logo-White.png", "clickthrough": "http://aniview.com/", "width": 2, "height": 2, "top": 1 }, "hideLogoOnAd": true }, "mobile": {}, "advanced": { "inViewRatio": 0.5, "startmidroll": 1, "midrolldelay": 2, "startaddelay": 3, "startdelay": 4, "playerDelay": 5, "closeevent": true, "showpreloader": true, "autoPlayContent": true, "showPos": true, "hideInitPreloader": true, "lastFrame": true, "nohideIframe": true, "waitForConsent": true }, "extensions": { "isActive": true, "preloader": { "type": 0, "contents": [] }, "passbackpriority": true, "passbackUrl": { "passbackUrlEnabled": false } } } }

Full Floating Request Example Payload :

{ "type": 1, "name": "float_req", "staging": { "performance": { "autoPlay": true, "loop": true, "autoContinue": true, "vastRetry": 1, "errorLimit": 2, "maxImp": 3, "maxRun": 4, "midrolltime": 5, "pauseOnUnseen": true, "pauseOnBlur": true, "reqOnView": true, "tabInView": true, "startOnView": true, "playOnView": true, "playOnViewPerc": 50 }, "content": { "type": 0 }, "appearance": { "playerMode": 1, "adLabel": { "text": "-Advertising Label-" }, "floating": { "position": 2, "resizingMethod": 1, "size": 50, "bottom": 10, "right": 20, "top": 10, "closeButton": true, "floatOnBottom": true, "floatOnImp": true }, "maxWidth": 10, "minHeight": 20, "maxzindex": 9999, "openAnim": true, "showPlayer": true, "customcss": ".class{}" }, "controls": { "timelineMode": "bottom", "closeButtonStyle": { "position": 1, "outside": true, "right": 5, "overlayMargin": 10 }, "pauseButton": true, "soundButton": true, "showVolumeControl": true, "volumeControlVertical": true, "showFullScreen": true, "showDuration": true, "showPrevButton": true, "showNextButton": true, "showBigPrevNext": true, "showBigPrevNextOnPause": true, "showBigPlay": true, "showPauseButton": true, "showBigPlayOnPause": true, "showReplay": true, "closeButton": true, "skip": true, "skipTimer": 6, "skipText": "Skip Text" }, "logo": { "logo": true, "customLogo": { "customLogoEnabled": false }, "hideLogoOnAd": true }, "mobile": {}, "advanced": { "inViewRatio": 1, "startmidroll": 2, "midrolldelay": 3, "startaddelay": 4, "startdelay": 5, "playerDelay": 6, "closeevent": true, "showpreloader": true, "autoPlayContent": true, "showPos": true, "hideInitPreloader": true, "lastFrame": true, "waitForConsent": true, "nohideIframe": true }, "extensions": { "isActive": true, "preloader": { "type": 0, "clickThrough": null } } } }

Full Sticky Request Example Payload :

The parameters that you can define for an Outstream Template are broken down into the following categories: Main, Performance, Appearance, Extensions, Controls, Logo, Advanced.

Main

  • All following parameters should be placed inside "staging": {}

Parameter

Type

Description

Mandatory

type

Int

1 = outstream

Yes

name

String

Template title

Yes

description

String

Template description

No

Performance

Parameter

Type

Description

autoContinue

Boolean

If set false - the next video won’t play automaticly

autoPlay

Boolean

If set false - ads won’t be called automaticaly

errorLimit

Int

Set the maximum number of full waterfall runs in a row without generating an impression.

Resets to 0 after an impression is generated.

loop

Boolean

Set true for ads to loop

maxImp

Int

Enter an amount to limit the number of impressions.

maxRun

Int

Enter an amount to limit the number of waterfall runs.

midrolltime

Int

Time(s) to wait between each waterfall run.

pauseonBlur

Boolean

Select for player to pause when browser window is out of focus.

pauseonUnseen

Boolean

Select for player to pause when out of view.

playOnView

Boolean

Select for the player to automatically check viewability and only call a startAd when in view.

playOnViewPerc

Number

Define the percentage of player needed to be on view to automatically play.

reqOnView

Boolean

Select for player to only call ad sources when in view.

startOnView

Boolean

Select for the player to automatically check viewability and only call a startAd when in view.

tabInView

Boolean

Select for the player to load and start only when in view.

vastRetry

Int

Set the number of consecutive waterfall retries.

Appearance

The Appearance parameters to change are broken down into 3 categories: Caption, Mode, Sizing.

Caption

Parameter

Type

Description

adLabel

String

Select to show an advertising label in the caption above the player view.

text

String

Change the text that appears in the caption above the player view.

Mode

Parameter

Type

Description

type

int

Inread:0,Floating:1,Sticky:2

Floating

The floating player will start as an Inread player and after scrolling up or down will become a sticky player.

Parameter

Type

Description

bottom

Int

Define the size of the bottom margin(px).

top

Int

Define the size of the top margin(px).

closeButton

Boolean

Set true to show a close button

floatOnBottom

Boolean

Select for the player to float when scrolled past it and above it.

floatOnImp

Boolean

Select for the player to start floating after an impression.

position

Int

Mandatory

(0:Bottom Right, 1:Bottom Left, 2:Top Right, 3:Top Left)

Select the corner where the player will float to.

right

Int

Define the size of the right margin(px).

left

Int

Define the size of the left margin(px).

size

Number

Select to define the percentage size of the floating player compared to its original size.

Sticky

The sticky player will receive a fixed placement on the screen and will stay there after scrolling.

Parameter

Type

Description

bottom

Int

Define the size of the bottom margin(px).

position

Int

Mandatory

(0:Bottom Right, 1:Bottom Left, 2:Top Right, 3:Top Left)

Select the corner where the player will stick to.

right

Int

Define the size of the right margin(px).

left

Int

Define the size of the left margin(px).

top

Int

Define the size of the top margin(px).

Sizing

Parameter

Type

Description

customcss

String

Define Custom CSS to change the visual appearance of the player.

floating

Null

Set null for inread.

sticky

Null

Set null for inread.

height

Int

Set fixed height in pixels, keep null if set to responsive.

width

Int

Set fixed height in pixels, keep null if set to responsive.

maxWidth

Int

If player set to responsive, maximum width can be set in pixels.

minHeight

Int

If player set to responsive, maximum height can be set in pixels.

openAnim

Boolean

Set true for the player to open with an animation.

playerMode

Int

Player Mode Type (0:InRead, 1:Floating, 2:Sticky

showPlayer

 

Boolean

Set true for the player to always be shown and not hidden until there is an ad.

maxzindex

Int

Defines the order of the elements on the z-axis.


Preloader

A preloader image or video can be added to be shown between the ads or a passback if no ads are available.

Parameter

Type

Description

type

Int

JS:0,Image:1,Content:3

Preloader:JavaScript

Parameter

Type

Description

close

Boolean

Set true to show a close button when the preloader appears.

color

Array

Select or enter the background color for the iFrame.

height

Int

Mandatory to define the height of the iFrame(px).

url

String

Mandatory field to enter a valid URL starting with http://.

width

Int

Mandatory to define the width of the iFrame(px).

Preloader:Image

Parameter

Type

Description

clickThrough

String

Enter a valid URL starting with http://.

link

String

Mandatory field to enter a valid URL starting with http://.

Preloader:Content

Parameter

Type

Description

autoPlay

Boolean

Set true for the video to start automatically. Set false for the video to play on Click-To-Play

clickThrough

String

Enter a valid URL starting with http://.

url

String

Mandatory field

Enter a valid URL starting with http://.

poster

String

Enter a valid URL starting with http:// to an image that will be shown while the content is loading.

preroll

Int

Define a maximum number of 4 preroll ads that will try to generate.

prerollTimeout

Int

Define the time for the player to generate preroll ads, minimum of 3 seconds.

random

Boolean

Select to randomize the order in which the different videos are reproduced.

Preloader:Passback

Parameter

Type

Description

noPassbackOnImp

Boolean

If set true, the passback won’t be activated after an impression is made.

noXPassback

Boolean

Set true to remove the close button from the passback.

color

Array

Enter the background color for the iFrame.

height

Int

Mandatory to define the height of the iFrame (px).

width

Int

Mandatory to define the width of the iFrame (px).

nofloat

Boolean

Set true to prevent the iFrame with the passback from floating, relevant only if Player Mode is floating.

passbackUrlEnabled

Boolean

Set true for the player to call a Third Party JavaScript, loaded within an iFrame, after all retries without an impression.

url

String

Mandatory field to enter a valid URL starting with http://.

passbackpriority

Boolean

Set ture to show the passback, even if there is a preloader.

Preloader:Logo

Parameter

Type

Description

logo

Boolean

Preselected to show a logo on the top right corner of the player.

Note selecting without a logo URL field means the default Aniview logo will appear.

clickThrough

String

Enter a valid URL starting with http://.

customLogoEnabled

Boolean

Select to customize the logo appearing instead of the Aniview logo.

height

Int

Enter to define the height of the logo(px).

link        

String

Mandatory field to enter a valid URL starting with http://.

text

String

Define the text that appears right next to the logo e.g., Ads by.

top

Int

Enter to define the distance from the top frame(px).

width

Int

Enter to define the width of the logo(px).

hideLogoOnAd

Boolean

Select to hide logo when showing ads.

Preloader:Advaced

Parameter

Type

Description

autoPlayContent

Boolean

Set true to auto play the content preloader when in view.

closeevent

Boolean

If set true, the developer will need to set an event listener on the close event. Which will be called before closing the player.

hideInitPreloader

Boolean

Set true to hide the preloader until there is an ad.

inViewRatio

Number

Enter a number between 0 and 1 to define the required viewability of the player for floating/sticky.

lastFrame

Boolean

Set true to freeze the MP4 video when it reaches the end.

midrolldelay

Int

Define the number of seconds to wait before the player starts to searching for the first ad.

nohideIframe

Boolean

Set true to not hide the I-Frame.

showPos

Boolean

Set true for the player to immediately use its space in the page. The page will not move when the player opens.

showpreloader

Boolean

Set true to show the loading icon while the player searches for an ad.

startaddelay

Int

Define the number of seconds waited before calling startAd. Allows extra time for a higher priority Ad Sources to respond with Ad Loaded.

startdelay

Int

Define the number of seconds to wait before calling startAd for the first time. The player loads and searches for ads, but delays the call to startAd.

startmidroll

Int

Define the number of seconds to wait after an impression and call startAd for the next one.

waitforConsent

Boolean

Select to wait for consent in the EU before requesting ads.


3.2.2 Create Instream Template

Instream template is created for player tags that play content with ad breaks.

The template allows customizing the player’s appearance and functionality. A single template can be set to service multiple channels. The connection between the channel and template is done under the tag entity.

Request Example payload:

Minimal Request Example Payload :



Full Inread Request Example Payload :


Floating Request Example Payload :


Sticky Request Example Payload :



The parameters that you can define for an Instream Template are broken down into the following categories: Main, Content, Ad Config, Performance, Appearance, Mobile, Controls, Logo, Advanced

Main

Parameter

Type

Description

Mandatory

type

Int

2 = instream

Yes

name

String

Template title

Yes

description

String

Template description

No

All following parameters should be placed inside “staging“:{}

Get Content Video List

Request Path:

https://manage.aniview.com/api/video/entry?format=json

Request Method:

GET

Request Parameters:

Video Content Type (1:custom, 2:entry).

Parameter

Type

Description

breakingAds

Null

Time in seconds between waterfalls.

breakingAdsMode

Null

Select from Ads Mode Type (1:Slot, 2:Breaking Ads).

commonSlots

Null

Set Common Slots.

clickThroughUrl

String

Enter a valid click through URL starting with http://.

fallbackUrl

String

Add a fallback video enter a valid URL starting with http://.

id

String

Video ID number

name

String

Enter a name for the video or select from preloaded videos.

oldId

String

Old Video ID number

thumbnailUrl

String

To add a thumbnail enter a valid URL starting with http://.

type

Array

Content Type (1=Custom, 2=Entry)

url

String

Mandatory field to enter a valid URL for the video content starting with http://.

firstPrerollSlot

Null

Content time in seconds for an ad to start.

firstPrerollSlotEnable

Null

Select to configure the preroll session.

order

Null

Order Type (1=Sequence, 2=Random).

Preset to Sequence, toggle to select Random.

randomFrom

Null

Define from which content number the player will start to randomize.

tagContent

Null

Select for the player to only show content from the tag and not merge content from the tag and template.

Get Content Video List

Parameter

Type

Description

errorLimit

Int

Set the maximum number of full waterfall runs in a row without generating an impression.

Resets to 0 after an impression is generated.

logo

Boolean

Set true for the player to show the logo.

pauseButton

Boolean

Set true for the player to have a Play/Pause button.

reqOnView

Boolean

Set true for player to only call ad sources when in view.

skip

Boolean

Set true to show a skip button within the player.

skipText

String

Only if skip set to true. Preset as Skip Ad. Customize the skip button text.

skipTimer

Int

Only if skip set to true. Preset to 5 seconds. Define the number of seconds to wait before showing the Skip Button.

soundButton

Boolean

Set true to start the player with sound. Note that auto play ads start muted.

tabInView

Boolean

Select for player to automatically check the browser tab is viewable before the ad starts.

vastRetry

Int

Set the number of consecutive waterfall retries.

Performance

Parameter

Type

Description

autoContinue

Boolean

Preset as selected.

Deselect for the next video to not play automatically.

autoPlay

Boolean

Preset as selected.

Deselect for an ad to not be called automatically.

time

Int

The number of seconds after that the player will skip to the next content.

timeout

Int

The number of seconds before a skip is enabled, to show the next and skip buttons.

autoSkipEnabled

Boolean

Select for the player to skip the video after a defined number of seconds.

loop

Boolean

Preset as selected.

Deselect to not loop ads.

playOnView

Boolean

Select for the player to automatically check viewability and only call a startAd when in view.

playOnViewPercent

Number

Preset to 50%.

Define the percentage of player needed to be on view to automatically play.

Field appears when play on view is selected.

hidden

Boolean

Select for player to only appear when an ad has been fetched.

noFloat

Boolean

Select for the player to float only after an impression.

openAnim

Boolean

Select for player to open with an animation.

playButtonDelay

Int

Define the number of seconds until a play button appears, when the player is visible and there is no impression.

playOnView

Boolean

Select for player to show content when in view.

showPlayer

Boolean

Select for the player space to always be shown.

startModeEnabled

Boolean

Select for the player to display a poster from the first content until an ad has been fetched.

startVolume

Null

Set start  volume.

Mode

The Appearance Mode parameters to change are broken down into 2 categories, mode and sizing.

Parameter

Type

Description

Mode

0:Inread, 1:Floating, 2:Sticky

Inread - the player will be located in a specific location on the site and won’t be seen at all times. Floating - the player will start in the inread type and after the user will scroll through it, it will float on a fixed location on the screen. Sticky - the player will receive a fixed location on the screen at all times.

Mode:Floating

Parameter

Type

Description

bottom

Int

Bottom margin size(px).

top

Int

Top margin size(px).

closeButton

Boolean

Set true toShow close button on floating

floatOnBottom

Boolean

Set true for the player to float when scrolled past it and above it.

backgroundColor

Array

Define the background colour of the player.

textColor

Array

Define the font color of the player text.

textFont

Array

Define the font type of the player text.

textSize

Int

Define the font size of the player text.

height

Int

Define the height of the floating player(px).

position

Position Type (0:Bottom Right, 1:Bottom Left, 2:Top Right, 3:Top Left, 4:Top, 5:Bottom)

Select the corner where the player will float to.

resizingMethod

Resizing Method Type (1:Scale, 2:Fixed).

Define the size of the floating player by scale percentage or fixed height and width pixels.

right

Int

Define the size of the right margin(px).

left

Int

Define the size of the left margin(px).

size

Number

Select to define the percentage size of the floating player compared to its original size.

width

Int

Define the width the floating player(px).


Mode:Sticky

Parameter

Type

Description

bottom

Int

Define the size of the bottom margin(px).

backgroundColor

Array

Define the background colour of the player.

textColor

Array

Define the font color of the player text.

textFont

Array

Define the font type of the player text.

textSize

Int

Define the font size of the player text.

position

Position Type (0=Bottom Right, 1=Bottom Left, 2=Top Right, 3=Top Left, 4=Top, 5=Bottom)

Select the corner where the player will stick to.

right

Int

Define the size of the right margin(px).

left

Int

Define the size of the left margin(px).

top

Int

Define the size of the top margin(px).

Sizing

Parameter

Type

Description

customcss

String

Set Custom CSS to modify the player aperance. Use full CSS statement: .class{code:here}

width

Int

In case you don’t want the player to be responsive, set fixed height in px.

height

Int

In case you don’t want the player to be responsive, set fixed height in px.

maxWidth

Int

Set the maximum player width.

maxHeight

Int

Set the maximum player height.

playerSize

Boolean

For a none responsive player with fixed sizing set true.

Mobile

Parameter

Type

Description

hideGuiTimeout

Int

Set for how many seconds the UI will be displayed after a click.

showBigPlay

Boolean

Show Big Aniview logo Play Button when the player starts

showBigPlayOnPause

Boolean

Show Big Play Button on Pause

showBigPrevNext

Boolean

Show Big Preview and Next Buttons.

showFullScreen

Boolean

Show Fullscreen Button.

showNextButton

Boolean

Show Next Button.

showPauseButton

Boolean

Showb Pause Button.

showPrevButton

Boolean

Show Previous Button.

Controls (for player GUI - graphical interface)

Parameter

Type

Description

closeButton

Boolean

Show close button (top left corner)

position

(1:Top Right, 2:Top Left)

Set close button position

left

Int

Only if position:2, set left margin

right

Int

Only if position:1, set right margin

outside

Boolean

Set true to show the close button above the player.

overlayMargin

Int

Set the non clickable area around the close button.

 

durationPosition

(1:Left, 2:Right)

Locate timeline duration.

moveXSec

Boolean

Enable forward and backward time jumps in seconds.

xSec

Int

Specify time jump in seconds. Default is 10 seconds.

showBigPlay

Boolean

Show Big Aniview logo Play Button when the player starts

showbigPlayOnPause

Boolean

Show Big Play Button on Pause

showBigPrevNext

Boolean

Show Big Preview and Next Buttons.

showBigPrevNextOn Pause

Boolean

Show Big Previous and Next Buttons on pause.

duration

Boolean

Show the duration in the timeline.

fullscreen

Boolean

Shwow Fullscreen Button in the timeline.

showNext

Boolean

Show Next Button in the timeline.

showPauseButton

Boolean

Show Big Pause Button.

showPrevButton

Boolean

Show Previous Button in the timeline.

showReplay

Boolean

Show The Replay Button on the timeline.

showTitle

Boolean

Show the title of the video.

showVolumeControl

Boolean

Show valum bar

soundButton

Boolean

Show turn sound on button.

soundButtonPosition

1:Left, 2:Right

Set the location of the volume button in the timeline.

timelineMode

Overlay, Bottom, None

Timeline type.

titlePosition

1:Left, 2:Right

Set title postion

volumeControlVertical

Boolean

Set valum bar appearance to vertical

Logo

Parameter

Type

Description

customLogoEnabled

Boolean

Set true to replace Aniview logo with custom logo.

clickthrough

String

Enter a valid URL starting with http://.

height

Int

Enter to define the height of the logo(px).

width

Int

Enter to define the width of the logo(px).

link

String

Logo resource link

position

1:Left, 2:Right

Select logo positon.

text

String

Replace the title “Ads by Aniview” with custom text.

logo

Boolean

Set true to show Aniviews logo.

Advanced

Parameter

Type

Description

hideGuiTimeout

Int

Set for how many seconds the UI will be displayed after a click.

noPauseOnClickthrough

Boolean

Set true for the content to continue playing on Click Through

spinner

1:Default, 2:Dots, 3:None

Select from Spinner Type.

syncVolume

Boolean

Set true to sync the content and ads valum.

themeColor

Array

Set theme color.

Content : Playlist/Video

Using Aniviews CMS

Parameter

Type

Description

type

Aniview CMS:0, Hosted Links:1

For Anviews CMS

cmsType

“video”/”playlist”

Choose between a pre created playlist and a single video

cmsId

Int

The CMS id

Content : Contents (for each video)

Parameter

Type

Description

duration

Int

Video duration

name

string

Video name

url

URL

Video URL

fallbackUrl

URL

Fallback URL

clickThroughUrl

URL

Click through URL

thumbnailUrl

URL

Thumbnail URL

type

Custom:0, CMS:1

CMS type

Request Example Payload :


Edit Template

Request URL:
https://manage.aniview.com/api/taggenerator/player-template/{Template_id}?format=json

Request Method:
PUT

Status Code:
200 OK

Parameter

Description

_id > $oid

Tempale ID

Request Example Payload :


Archive Template

Request URL:
https://manage.aniview.com/api/taggenerator/player-template/{Template_id}?format=json  

Request Method:
DELETE

Status Code:
200 OK


3.2.3 Generate Template Config Json

Request URL:
https://tg1.aniview.com/api/adserver/spc?AV_PUBLISHERID=${PUBLISHERID_ID}&AV_TEMPID=${TEMPLATE_ID}

Request Method:
GET

Status Code:
200 OK

Parameter

Description

AV_PUBLISHERID

Publisher ID

AV_TEMPID

Template ID