Insertion Policy API

Note: The Insertion Policy API works only with the new Insertion Policy functionality, which needs to be enabled for your account. For more information, refer to Insertion Policies, Insertion Policies Interface Overview, and Create Insertion Policy.

Getting Started

Note: Only successful responses are shown in the examples. Details about unsuccessful responses are found in the swagger documentation.

Request Body Format

To create or update an insertion policy, you need to supply a body to the request with the following format:
Note: All parameters are optional unless explicitly stated.
{
    "id": "<string>",    (ID of the insertion policy; required only  for the update request)
    "name": "<string>",  (Name of the insertion policy, required)
    "tagRule": {         (A list of tags, by default you can add up to 20 tags per insertion policy)
        "oneOf": [
            "<string>",
            "<string>"        
        ]
    },
    "categoryRule": {    (A list of Share IDs, by default you can add up to 29 categories per insertion policy)
        "oneOf": [
            "<string>",
            "<string>"        
        ]
    },
    "globalSettings": {
        "skipButton": {    (See table below for more information on skip ad button settings)
            "showWhen": "<ALWAYS|NEVER|AFTER_FIRST_UNIQUE>",  (defaults to NEVER)
            "resetAfter": "<3600|7200|10800|21600|43200|86400|129600|172800>",  (Defaults to 86400 seconds)
            "skipOffset": {
                "value": "<integer>",    (Defaults to 0)
                "unit": "<SECONDS|PERCENT>"    (Defaults to SECOND)
            }
        },
        "minimumTimeBetweenAds": "<0|60|120|180|240|300|360|420|480|540|600|1200|1800|2400|3000|3600>"  (Time-based frequency cap; defaults to 180)
    },
    "adBreakSettings": {
        "standardSpotsEnabled": "<boolean>",    (Defaults to true)
        "interactiveSpotsEnabled": "<boolean>",    (Defaults to false)
        "preroll": {
            "enabled": "<boolean>",    (Defaults to false)
            "timeLimit": {
                "enabled": "<boolean>",    (Defaults to false)
                "seconds": "<integer>"    (integer >1, defaults to 30)
            },
            "adsPerBreak": "<integer>"    (1-25, defaults to 1)
        },
        "midroll": {
            "enabled": "<boolean>",    (Defaults to false)
            "timeLimit": {
                "enabled": "<boolean>",    (Defaults to false)
                "seconds": "<integer>"    (integer >1, defaults to 30)
            },
            "adsPerBreak": "<integer>"    (1-25, defaults to 1)
        },
        "postroll": {
            "enabled": "<boolean>",    (Defaults to false)
            "timeLimit": {
                "enabled": "<boolean>",    (Defaults to false)
                "seconds": "<integer>"    (integer >1, defaults to 30)
            },
            "adsPerBreak": "<integer>"    (1-25, defaults to 1)
        },
        "seekroll": {
            "enabled": "<boolean>",    (Defaults to false)
            "timeLimit": {
                "enabled": "<boolean>",    (Defaults to false)
                "seconds": "<integer>"    (integer >1, defaults to 30)
            },
            "adsPerBreak": "<integer>",   (1-25, defaults to 1)
            "minSeekEvents": "<integer>"    (Minimum number of seek events needed to trigger a seekroll break; 1-25, defaults to 3)
        }
    },
    "pauseAdSettings": {
        "enabled": "<boolean>"    (Defaults to false)
    },
    "overlaySettings": {
        "enabled": "<boolean>",    (Defaults to false)
        "duration": "<5|10|15|20|25|30>",  (Number of seconds, defaults to 15)
        "firstInsertion": "<5|10|15|20|25|30|35|40|45|50|55|60>", (Number of seconds, defaults to 20)
        "frequency": "<60|120|180|240|300|360|420|480|540|600>"  (1-10 minutes expressed in seconds, defaults to 180)
    }
  }         
}

The table below explains the skip ad button settings and indicates which parameters you need to send in depending on when you want the skip ad button to appear (always, never, or after first unique view).

Table 1. Skip Ad Button Settings
Parameter Description ALWAYS NEVER AFTER_FIRST_UNIQUE
showWhen Select whether to show the skip ad button always, after first unique view, or never. x x x
resetAfter Reset view count after a certain time period. You can choose to reset on a scale from 1 to 48 hours, expressed in seconds.     x
skipOffset Set the amount of seconds, or the percentage of the ad, after which the skip button appears.
  • value: amount of seconds or the percentage of the ad
  • unit: SECOND or PERCENT
x   x

Retrieve Insertion Policy Template

Method GET
URL https://api.videoplaza.com/v0/insertion-policy/template
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body -
Success response

HTTP status: 200 OK

Header: -

Body: insertion policy template with all available parameters and their default values

Example:

Request header:

GET /v0/insertion-policy/template HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response:

HTTP status:
  200 (OK)

{
    "name": "",
    "tagRule": {
        "oneOf": []
    },
    "categoryRule": {
        "oneOf": []
    },
    "globalSettings": {
        "skipButton": {
            "showWhen": "NEVER",
            "resetAfter": 86400,
            "skipOffset": {
                "value": 0,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": false,
        "preroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1
        },
        "midroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1
        },
        "postroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": false
    },
    "overlaySettings": {
        "enabled": false,
        "duration": 15,
        "firstInsertion": 20,
        "frequency": 180
    }
}

Create Insertion Policy

Note: By default, you can create up to 50 insertion policies for your Pulse account and specify up to 20 tags and/or 29 categories per one insertion policy. Contact your Account Manager if you need to change these values.
Method POST
URL https://api.videoplaza.com/v0/insertion-policy
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body Request Body Format
Note: Only the name parameter is required.
Success response

HTTP status: 201 Created

Header: Location: URI to the location of your insertion policy

Body: insertion policy including insertion policy ID

Example:

Request header:

POST /v0/insertion-policy HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
    "name": "Loyal users",
    "tagRule": {
        "oneOf": [
            "loyal_user",
            "loyal_user_male",
            "loyal_user_female"
        ]
    },
    "categoryRule": {
        "oneOf": [
            "ae823a6e-8818-4f96-a4ef-b9c9204d88c0",
            "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
            "43c4646e-496d-43df-b894-16a74339bc0a"
        ]
     },
    "globalSettings": {
        "skipButton": {
            "showWhen": "AFTER_FIRST_UNIQUE",
            "resetAfter": 43200,
            "skipOffset": {
                "value": 10,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": true,
        "preroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 4
        },
        "midroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 3
        },
        "postroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 3
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": true
    },
    "overlaySettings": {
        "enabled": true,
        "duration": 15,
        "firstInsertion": 20,
        "frequency": 180
    }
}

Success response:

HTTP status:
  201 (Created)

Header:
  Location: <URI with the location of your insertion policy>

Body:
{
    "id": "9cb4e9fc-5c45-479d-84ae-02540be3fd77",
    "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
    "name": "Loyal users",
    "tagRule": {
        "oneOf": [
            "loyal_user",
            "loyal_user_male",
            "loyal_user_female"
        ]
    },
    "categoryRule": {
        "oneOf": [
            "ae823a6e-8818-4f96-a4ef-b9c9204d88c0",
            "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
            "43c4646e-496d-43df-b894-16a74339bc0a"
        ]
     },
    "globalSettings": {
        "skipButton": {
            "showWhen": "AFTER_FIRST_UNIQUE",
            "resetAfter": 43200,
            "skipOffset": {
                "value": 10,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": true,
        "preroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 4
        },
        "midroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 3
        },
        "postroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 3
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": true
    },
    "overlaySettings": {
        "enabled": true,
        "duration": 15,
        "firstInsertion": 20,
        "frequency": 180
    }
}

Update Insertion Policy

Method PUT
URL https://api.videoplaza.com/v0/insertion-policy
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body Request Body Format
Note: You must pass in the insertion policy ID.
Success response

HTTP status: 200 OK

Header: -

Body: insertion policy with insertion policy ID

Example:

Request header:

PUT /v0/insertion-policy HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
    "id": "9cb4e9fc-5c45-479d-84ae-02540be3fd77",
    "name": "Loyal users",
    "tagRule": {
        "oneOf": [
            "loyal_user",
            "loyal_user_male",
            "loyal_user_female"
        ]
    },
    "categoryRule": {
        "oneOf": []
     },
    "globalSettings": {
        "skipButton": {
            "showWhen": "ALWAYS",
            "resetAfter": 86400,
            "skipOffset": {
                "value": 5,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": true,
        "preroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "midroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "postroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": true
    },
    "overlaySettings": {
        "enabled": true,
        "duration": 20,
        "firstInsertion": 20,
        "frequency": 180
    }
}

Success response:

HTTP status:
  200 (OK)

Body:
{
    "id": "9cb4e9fc-5c45-479d-84ae-02540be3fd77",
    "name": "Loyal users",
    "tagRule": {
        "oneOf": [
            "loyal_user",
            "loyal_user_male",
            "loyal_user_female"
        ]
    },
    "categoryRule": {
        "oneOf": []
     },
    "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
    "globalSettings": {
        "skipButton": {
            "showWhen": "ALWAYS",
            "resetAfter": 86400,
            "skipOffset": {
                "value": 5,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": true,
        "preroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "midroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "postroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": true
    },
    "overlaySettings": {
        "enabled": true,
        "duration": 20,
        "firstInsertion": 20,
        "frequency": 180
    }
}

List Insertion Policies

Use this to retrieve a paginated list of all insertion policies belonging to your site. By default, without adding any query parameters, you get a list of the first 10 insertion policies. The insertion policies are returned in ranked order, from highest to lowest.

Method GET
URL https://api.videoplaza.com/v0/insertion-policy
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params
  • pageSize=<integer>: specify the number of insertion policies listed per one page.
  • pageNumber=<integer>: list insertion policies by page number. If you do not define the pageSize=<integer> query parameter, you get a list of 10 insertion policies per defined page.
Body -
Success response

HTTP status: 200 OK

Header: -

Body: list of insertion policies

Example:

Request header:

GET /v0/insertion-policy?pageSize=15&pageNumber=2 HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response:

HTTP status:
  200 (OK)

{
    "data": [
        {
            "id": "289ebaf9-0742-4bb9-a688-cf2c95425260",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "High Ad Load",
            "tagRule": {
                "oneOf": [
                    "9am_news",
                    "sport_game_finale",
                    "reality_show",
                    "idol"
                ]
            },
            "categoryRule": {
                "oneOf": [
                    "ae823a6e-8818-4f96-a4ef-b9c9204d88c0",
                    "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
                    "43c4646e-496d-43df-b894-16a74339bc0a",
                    "c3368339-d184-4265-b04e-21fef69e92d2",
                    "44452a41-da2d-4616-9d67-f009ec2c65c3",
                    "35edb3f1-536a-4b18-a5ab-264d581fb121"
                ]
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "AFTER_FIRST_UNIQUE",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 10,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": true,
                "preroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 4
                },
                "midroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "postroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "seekroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": true
            },
            "overlaySettings": {
                "enabled": true,
                "duration": 15,
                "firstInsertion": 20,
                "frequency": 180
            }
        },
        {
            "id": "9f8fb7a3-8da0-4ad5-9b43-6a23fdfb81b1",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "Loyal users",
            "tagRule": {
                "oneOf": [
                    "loyal_user",
                    "loyal_user_male",
                    "loyal_user_female"
                ]
            },
            "categoryRule": {
                "oneOf": []
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "ALWAYS",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 5,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": true,
                "preroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "midroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "postroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "seekroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": true
            },
            "overlaySettings": {
                "enabled": true,
                "duration": 20,
                "firstInsertion": 20,
                "frequency": 180
            }
        },
        {
            "id": "e763bfd9-c933-44f8-95a0-2084cd7bcae3",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "TV Show Season Finale",
            "tagRule": {
                "oneOf": [
                    "season_finale"
                ]
            },
            "categoryRule": {
                "oneOf": [
                    "35edb3f1-536a-4b18-a5ab-264d581fb121",
                    "843bdec0-6024-4947-96b4-feaced262618",
                    "9937f99b-459b-446a-9300-1daeed8ff0a4",
                    "bcf8c6db-c90c-46c8-a451-cbf3fa444e96",
                    "dee051f9-6d44-4957-a9e6-3783750ee697",
                    "1aad19e9-81b3-4c62-b3cf-4a660edc424c",
                    "41ef1c5e-345e-4dd4-ab6e-8f08c1ebf1a7",
                    "43c4646e-496d-43df-b894-16a74339bc0a",
                    "9c039f86-4eba-42d3-b3ad-8336fea843a8",
                    "bf538844-10cf-47df-997c-89691ff4c3ad",
                    "e1b6b64a-ceec-4dd8-a259-6b7bc6e94e5d"
                ]
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "NEVER",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 0,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": false,
                "preroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 4
                },
                "midroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "postroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "seekroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": false
            },
            "overlaySettings": {
                "enabled": false,
                "duration": 15,
                "firstInsertion": 20,
                "frequency": 180
            }
        },
        {
            "id": "33dd0be1-2fab-48c8-bd83-127fbc9294e8",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "Medium Ad Load",
            "tagRule": {
                "oneOf": [
                    "LWT",
                    "john_oliver",
                    "band_of_brotheres",
                    "GOT",
                    "HOC"
                ]
            },
            "categoryRule": {
                "oneOf": [
                    "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
                    "f86e4171-c70f-45fb-8f12-4a0c0fb3f511",
                    "fcbf28c0-9499-4544-9f9f-636cf8bb2d09",
                    "0e34a70d-c467-4a70-9d7a-555c686d7718",
                    "58157696-8e87-4671-80df-69a22f92a76a"
                ]
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "NEVER",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 0,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": false,
                "preroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "midroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "postroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "seekroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": false
            },
            "overlaySettings": {
                "enabled": false,
                "duration": 15,
                "firstInsertion": 20,
                "frequency": 180
            }
        },
        {
            "id": "6ae4425e-c961-433e-a439-c7b0dd6c6c33",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "TV Show Season Premiere",
            "tagRule": {
                "oneOf": [
                    "premiere"
                ]
            },
            "categoryRule": {
                "oneOf": []
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "NEVER",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 0,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": false,
                "preroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 3
                },
                "midroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "postroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2
                },
                "seekroll": {
                    "enabled": true,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 2,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": false
            },
            "overlaySettings": {
                "enabled": false,
                "duration": 15,
                "firstInsertion": 20,
                "frequency": 180
            }
        },
        {
            "id": "0780907f-7699-496a-bca8-177774eaeed7",
            "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
            "name": "Sport",
            "tagRule": {
                "oneOf": [
                    "sport"
                ]
            },
            "categoryRule": {
                "oneOf": []
            },
            "globalSettings": {
                "skipButton": {
                    "showWhen": "NEVER",
                    "resetAfter": 86400,
                    "skipOffset": {
                        "value": 0,
                        "unit": "SECONDS"
                    }
                },
                "minimumTimeBetweenAds": 180
            },
            "adBreakSettings": {
                "standardSpotsEnabled": true,
                "interactiveSpotsEnabled": false,
                "preroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1
                },
                "midroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1
                },
                "postroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1
                },
                "seekroll": {
                    "enabled": false,
                    "timeLimit": {
                        "enabled": false,
                        "seconds": 30
                    },
                    "adsPerBreak": 1,
                    "minSeekEvents": 3
                }
            },
            "pauseAdSettings": {
                "enabled": false
            },
            "overlaySettings": {
                "enabled": false,
                "duration": 15,
                "firstInsertion": 20,
                "frequency": 180
            }
        }
    ],
    "pagination": {
        "totalCount": 21,
        "pageSize": 15,
        "pageNumber": 2
    }
}

List Insertion Policies by Insertion Policy ID

Method GET
URL https://api.videoplaza.com/v0/insertion-policy/{id}
Header Authentication header (x-o-api-key)
Content type application/json
URL params Insertion policy ID
Query params -
Body -
Success response

HTTP status: 200 OK

Header: -

Body: specified insertion policy

Example:

Request header:

GET /v0/insertion-policy/9cb4e9fc-5c45-479d-84ae-02540be3fd77 HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response:

HTTP status:
  200 (OK)

{
    "id": "9f8fb7a3-8da0-4ad5-9b43-6a23fdfb81b1",
    "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
    "name": "Loyal users",
    "tagRule": {
        "oneOf": [
            "loyal_user",
            "loyal_user_male",
            "loyal_user_female"
        ]
    },
    "categoryRule": {
        "oneOf": []
    },
    "globalSettings": {
        "skipButton": {
            "showWhen": "ALWAYS",
            "resetAfter": 86400,
            "skipOffset": {
                "value": 5,
                "unit": "SECONDS"
            }
        },
        "minimumTimeBetweenAds": 180
    },
    "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": true,
        "preroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "midroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "postroll": {
            "enabled": true,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 2
        },
        "seekroll": {
            "enabled": false,
            "timeLimit": {
                "enabled": false,
                "seconds": 30
            },
            "adsPerBreak": 1,
            "minSeekEvents": 3
        }
    },
    "pauseAdSettings": {
        "enabled": true
    },
    "overlaySettings": {
        "enabled": true,
        "duration": 20,
        "firstInsertion": 20,
        "frequency": 180
    }
}

Update Insertion Policy Rank

Method PUT
URL https://api.videoplaza.com/v0/insertion-policy/rank
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body
{
  "ids": [
    "<string>"    (ID of the policy whose rank you want to change)
  ],
  "idAfter": "<string>",  (ID of the insertion policy under which you want to move your insertion policy)
  "idBefore": "<string>"  (ID of the insertion policy above which you want to move your insertion policy)
}
Note: You can only update the rank of one insertion policy per request and you only need to supply one of idAfter or idBefore.
Success response

HTTP status: 200 OK

Header: -

Body: -

Example:

Request header:

PUT /v0/insertion-policy/rank HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
  "ids": [
    "0780907f-7699-496a-bca8-177774eaeed7"
  ],
  "idBefore": "6ae4425e-c961-433e-a439-c7b0dd6c6c33"
}

Success response:

HTTP status:
  200 (OK)

Was this article helpful?