Insertion Policy API

The Insertion Policy API allows you to create insertion policies and target them against tags, categories, or a precise combination of tags and categories. It works only with the new Insertion Policy feature, which needs to be enabled for your account. Contact your Account Manager if you want to use this feature.

Prerequisites

Before you start using this API, see Insertion Policy to get an overview of the functionality and understand its requirements and limitations.

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. You can only configure the ad formats and settings that are enabled for your account.
{
  "id": "<string>",    (ID of the insertion policy, required only for the update request)
  "name": "<string>",  (Name of the insertion policy, required, use up to 255 characters)
  "tagRule": {    (List of tags, by default you can add up to 20 tags per insertion policy)
    "oneOf": [          
      "<string>",
      "<string>"        
    ],
    "allOf": [          
      "<string>",
      "<string>"        
    ],
    "noneOf": [    
      "<string>",
      "<string>"        
    ]
  },
  "categoryRule": {    (List of Category IDs, by default you can add up to 29 categories per insertion policy)
    "oneOf": [    
      "<string>",
      "<string>"        
    ]
  },
  "deviceContainers": [          
      "<string>",
      "<string>"        
  ],  
  "contentForm": "<LONG_FORM|SHORT_FORM>",  
  "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 SECONDS)
      }
    },
    "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>"    (0-50, defaults to 1; 0 means empty break but allows you to have sponsor pre-roll ads)
    },
    "midroll": {
      "enabled": "<boolean>",    (Defaults to false)
      "timeLimit": {
        "enabled": "<boolean>",    (Defaults to false)
        "seconds": "<integer>"    (Integer >1, defaults to 30)
      },
      "adsPerBreak": "<integer>",    (0-50, defaults to 1; 0 means empty break but allows you to have sponsor mid-roll ads)
      "advancedRules": {  
        "enabled": "<boolean>",    (Defaults to false)
        "rules": [    (You can add up to 10 rules; if advancedRules are enabled, at least one rules object is required)
          {
           "midrollBreakNumber": "<integer>",    (Integer >1)
           "adsPerBreak": "<integer>",    (0-50, defaults to 1; 0 means empty break but allows you to have sponsor mid-roll ads)
           "timeLimit": {
             "enabled": "<boolean>",    (Defaults to false)
             "seconds": "<integer>"    (Integer >1, defaults to 30)
            }
          }
        ]
      }
    },
    "postroll": {
      "enabled": "<boolean>",    (Defaults to false)
      "timeLimit": {
        "enabled": "<boolean>",    (Defaults to false)
        "seconds": "<integer>"    (Integer >1, defaults to 30)
      },
      "adsPerBreak": "<integer>"    (0-50, defaults to 1; 0 means empty break but allows you to have sponsor post-roll ads)
      },
    "seekroll": {
      "enabled": "<boolean>",    (Defaults to false)
      "timeLimit": {
        "enabled": "<boolean>",    (Defaults to false)
        "seconds": "<integer>"    (Integer >1, defaults to 30)
      },
      "adsPerBreak": "<integer>",    (1-50, 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: SECONDS or PERCENT
x x

Retrieve Insertion Policy template

This endpoint retrieves the insertion policy template with all available parameters and their default values. You can use it to create new insertion policies.

Method GET
URL https://api.videoplaza.com/v1/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

Example

Request header

GET /v1/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": [],
    "allOf": [],
    "noneOf": []
  },
  "categoryRule": {
    "oneOf": []
  },
  "deviceContainers": [],
  "contentForm": "SHORT_FORM",
  "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,
      "advancedRules": {
        "enabled": false,
        "rules": []
      }
    },
    "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 an Insertion Policy

By default, you can create up to 50 insertion policies for your Pulse account and specify up to 20 tags and 29 categories per one insertion policy. Contact your Account Manager if you need to change the maximum number of insertion policies or the maximum number of tags per one insertion policy.

Insertion policies are ranked in order of creation, with the most recent ones at the bottom (ranked lowest). You can Update Insertion Policy rank to mark the order in which Pulse should pick insertion policies when more than one insertion policy matches the tag targeting, category targeting, or both tag and category targeting coming in the ad request.

Note: Insertion policies without any specified targeting are currently not taken into consideration by the Pulse Distribution Engine.
Method POST
URL https://api.videoplaza.com/v1/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 /v1/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_male",
      "loyal_user_female"
    ],
    "allOf": [
      "loyal_user"
    ],
    "noneOf": [
      "violence",
      "kids"
    ]
  },
  "categoryRule": {
    "oneOf": [
      "43c4646e-496d-43df-b894-16a74339bc0a",
      "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
      "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
    ]
  },
  "deviceContainers": [          
    "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
    "123e4567-e89b-12d3-a456-556642440000"        
  ],  
  "contentForm": "SHORT_FORM",  
  "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": 2
    },
    "midroll": {
      "enabled": true,
      "timeLimit": {
        "enabled": false,
        "seconds": 30
      },
      "adsPerBreak": 2,
      "advancedRules": {
        "enabled": true,
        "rules": [
          {
            "midrollBreakNumber": 3,
            "adsPerBreak": 5,
            "timeLimit": {
              "enabled": true,
              "seconds": 110
            }
          },
          {
            "midrollBreakNumber": 5,
            "adsPerBreak": 6,
            "timeLimit": {
              "enabled": true,
              "seconds": 130
            }
          }
        ]
      }
    },
    "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": 15,
    "firstInsertion": 20,
    "frequency": 180
  }
}

Success response

HTTP status:
  201 (Created)

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

Body:
{
  "id": "9bb46636-b75d-4d65-9ab1-8fb21bb45871",
  "name": "Loyal users",
  "tagRule": {
    "oneOf": [
      "loyal_user_male",
      "loyal_user_female"
    ],
    "allOf": [
      "loyal_user"
    ],
    "noneOf": [
      "violence",
      "kids"
    ]
  },
  "categoryRule": {
    "oneOf": [
      "43c4646e-496d-43df-b894-16a74339bc0a",
      "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
      "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
    ]
  },
  "deviceContainers": [          
    "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
    "123e4567-e89b-12d3-a456-556642440000"       
  ],  
  "contentForm": "SHORT_FORM",  
  "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": 2
    },
    "midroll": {
      "enabled": true,
      "timeLimit": {
        "enabled": false,
        "seconds": 30
      },
      "adsPerBreak": 2,
      "advancedRules": {
        "enabled": true,
        "rules": [
          {
            "midrollBreakNumber": 3,
            "adsPerBreak": 5,
            "timeLimit": {
              "enabled": true,
              "seconds": 110
            }
          },
          {
            "midrollBreakNumber": 5,
            "adsPerBreak": 6,
            "timeLimit": {
              "enabled": true,
              "seconds": 130
            }
          }
        ]
      }
    },
    "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": 15,
    "firstInsertion": 20,
    "frequency": 180
  }
}

Update an Insertion Policy

Method PUT
URL https://api.videoplaza.com/v1/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 /v1/insertion-policy HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body

{
  "id": "9bb46636-b75d-4d65-9ab1-8fb21bb45871",
  "name": "Loyal users",
  "tagRule": {
    "oneOf": [
      "loyal_user_male",
      "loyal_user_female"
    ],
    "allOf": [
      "loyal_user"
    ],
    "noneOf": [
      "violence",
      "kids"
    ]
  },
  "categoryRule": {
    "oneOf": [
      "43c4646e-496d-43df-b894-16a74339bc0a",
      "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
      "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
    ]
  },
  "deviceContainers": [          
    "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
    "123e4567-e89b-12d3-a456-556642440000"       
  ],  
  "contentForm": "SHORT_FORM",  
  "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,
      "advancedRules": {
        "enabled": true,
        "rules": [
          {
            "midrollBreakNumber": 3,
            "adsPerBreak": 3,
            "timeLimit": {
              "enabled": true,
              "seconds": 60
            }
          },
          {
            "midrollBreakNumber": 5,
            "adsPerBreak": 4,
            "timeLimit": {
              "enabled": true,
              "seconds": 80
            }
          }
        ]
      }
    },
    "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": "9bb46636-b75d-4d65-9ab1-8fb21bb45871",
  "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
  "name": "Loyal users",
  "tagRule": {
    "oneOf": [
      "loyal_user_male",
      "loyal_user_female"
    ],
    "allOf": [
      "loyal_user"
    ],
    "noneOf": [
      "violence",
      "kids"
    ]
  },
  "categoryRule": {
    "oneOf": [
      "43c4646e-496d-43df-b894-16a74339bc0a",
      "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
      "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
    ]
  },
  "deviceContainers": [          
    "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
    "123e4567-e89b-12d3-a456-556642440000"     
  ],  
  "contentForm": "SHORT_FORM",  
  "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,
      "advancedRules": {
        "enabled": true,
        "rules": [
          {
            "midrollBreakNumber": 3,
            "adsPerBreak": 3,
            "timeLimit": {
              "enabled": true,
              "seconds": 60
            }
          },
          {
            "midrollBreakNumber": 5,
            "adsPerBreak": 4,
            "timeLimit": {
              "enabled": true,
              "seconds": 80
            }
          }
        ]
      }
    },
    "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 ranked to lowest ranked.

Method GET
URL https://api.videoplaza.com/v1/insertion-policy
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params All parameters are optional.
  • 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 /v1/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",
      "name": "High Ad Load",
      "tagRule": {
        "oneOf": [
          "9am_news",
          "sport_game_finale",
          "reality_show",
          "idol"
        ],
        "allOf": [],
        "noneOf": []
      },
      "categoryRule": {
        "oneOf": [
          "ae823a6e-8818-4f96-a4ef-b9c9204d88c0",
          "9c039f86-4eba-42d3-b3ad-8336fea843a8",
          "fcbf28c0-9499-4544-9f9f-636cf8bb2d09"
        ]
      },
      "deviceContainers": [          
        "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
        "123e4567-e89b-12d3-a456-556642440000"     
      ],  
      "contentForm": "SHORT_FORM",  
      "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": 150
          },
          "adsPerBreak": 3,
          "advancedRules": {
            "enabled": false,
            "rules": []
          }
        },
        "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": "e763bfd9-c933-44f8-95a0-2084cd7bcae3",
      "name": "TV Show Season Finale",
      "tagRule": {
        "oneOf": [
          "season_finale"
        ],
        "allOf": [],
        "noneOf": []
      },
      "categoryRule": {
        "oneOf": [
          "43c4646e-496d-43df-b894-16a74339bc0a"
        ]
      },
      "deviceContainers": [          
         "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
         "123e4567-e89b-12d3-a456-556642440000"      
      ],  
      "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,
          "advancedRules": {
            "enabled": false,
            "rules": []
          }
        },
        "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": 15,
        "firstInsertion": 20,
        "frequency": 180
      }
    },
    {
      "id": "33dd0be1-2fab-48c8-bd83-127fbc9294e8",
      "name": "Medium Ad Load",
      "tagRule": {
        "oneOf": [
          "LWT",
          "john_oliver",
          "band_of_brotheres",
          "GOT",
          "HOC"
        ],
        "allOf": [],
        "noneOf": []
      },
      "categoryRule": {
        "oneOf": [
          "e1b6b64a-ceec-4dd8-a259-6b7bc6e94e5d",
          "07796065-6833-448d-8308-35623bdfeda4",
          "ea8350c3-92b5-4cf4-8a4a-00e2e6de39b8"
        ]
      },
      "deviceContainers": [          
          "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
          "123e4567-e89b-12d3-a456-556642440000"        
      ],  
      "contentForm": "SHORT_FORM",  
       "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,
          "advancedRules": {
            "enabled": false,
            "rules": []
          }
        },
        "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": true,
        "duration": 15,
        "firstInsertion": 20,
        "frequency": 180
      }
    },
    {
      "id": "6ae4425e-c961-433e-a439-c7b0dd6c6c33",
      "name": "TV Show Season Premiere",
      "tagRule": {
        "oneOf": [
          "premiere"
        ],
        "allOf": [],
        "noneOf": []
      },
      "categoryRule": {
        "oneOf": []
      },
      "deviceContainers": [          
        "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
        "123e4567-e89b-12d3-a456-556642440000"      
      ],  
    "contentForm": "SHORT_FORM",
    "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,
          "advancedRules": {
            "enabled": false,
            "rules": []
          }
        },
        "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": true,
        "duration": 15,
        "firstInsertion": 20,
        "frequency": 180
      }
    },
    {
      "id": "0780907f-7699-496a-bca8-177774eaeed7",
      "name": "Sport",
      "tagRule": {
        "oneOf": [
          "sport"
        ],
        "allOf": [],
        "noneOf": []
      },
      "categoryRule": {
        "oneOf": []
      },
      "globalSettings": {
        "skipButton": {
          "showWhen": "NEVER",
          "resetAfter": 86400,
          "skipOffset": {
            "value": 50,
            "unit": "PERCENT"
          }
        },
        "minimumTimeBetweenAds": 180
      },
      "adBreakSettings": {
        "standardSpotsEnabled": true,
        "interactiveSpotsEnabled": false,
        "preroll": {
          "enabled": true,
          "timeLimit": {
            "enabled": false,
            "seconds": 60
          },
          "adsPerBreak": 2
        },
        "midroll": {
          "enabled": true,
          "timeLimit": {
            "enabled": true,
            "seconds": 40
          },
          "adsPerBreak": 2,
          "advancedRules": {
            "enabled": true,
            "rules": [
              {
                "midrollBreakNumber": 4,
                "adsPerBreak": 3,
                "timeLimit": {
                  "enabled": true,
                  "seconds": 60
                }
              },
              {
                "midrollBreakNumber": 6,
                "adsPerBreak": 5,
                "timeLimit": {
                  "enabled": true,
                  "seconds": 100
                }
              }
            ]
          }
        },
        "postroll": {
          "enabled": false,
          "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
      }
    },
    {
      "id": "9bb46636-b75d-4d65-9ab1-8fb21bb45871",
      "name": "Loyal users",
      "tagRule": {
        "oneOf": [
          "loyal_user_male",
          "loyal_user_female"
        ],
        "allOf": [
          "loyal_user"
        ],
        "noneOf": [
          "violence",
          "kids"
        ]
      },
      "categoryRule": {
        "oneOf": [
          "43c4646e-496d-43df-b894-16a74339bc0a",
          "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
          "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
        ]
      },
      "deviceContainers": [          
        "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
        "123e4567-e89b-12d3-a456-556642440000"        
      ],  
    "contentForm": "SHORT_FORM",
    "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,
          "advancedRules": {
            "enabled": true,
            "rules": [
              {
                "midrollBreakNumber": 3,
                "adsPerBreak": 3,
                "timeLimit": {
                  "enabled": true,
                  "seconds": 60
                }
              },
              {
                "midrollBreakNumber": 5,
                "adsPerBreak": 4,
                "timeLimit": {
                  "enabled": true,
                  "seconds": 80
                }
              }
            ]
          }
        },
        "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
      }
    }
  ],
  "pagination": {
    "totalCount": 6,
    "pageSize": 10,
    "pageNumber": 1
  }
}

Get Insertion Policy by Insertion Policy ID

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

HTTP status: 200 OK

Header: -

Body: insertion policy object

Example

Request header

GET /v1/insertion-policy/9bb46636-b75d-4d65-9ab1-8fb21bb45871 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": "9bb46636-b75d-4d65-9ab1-8fb21bb45871",
  "site": "74f50cfa-c64c-4cb3-a09a-552643ddf733",
  "name": "Loyal users",
  "tagRule": {
    "oneOf": [
      "loyal_user_male",
      "loyal_user_female"
    ],
    "allOf": [
      "loyal_user"
    ],
    "noneOf": [
      "violence",
      "kids"
    ]
  },
  "categoryRule": {
    "oneOf": [
      "43c4646e-496d-43df-b894-16a74339bc0a",
      "d1caaa01-ca17-43d1-b0a5-adfdd06a72e0",
      "ae823a6e-8818-4f96-a4ef-b9c9204d88c0"
    ]
  },
  "deviceContainers": [          
      "6b6535fb-7ca3-4aea-a783-92f99e698d4c",
      "123e4567-e89b-12d3-a456-556642440000"     
  ],  
  "contentForm": "SHORT_FORM",
  "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,
      "advancedRules": {
        "enabled": true,
        "rules": [
          {
            "midrollBreakNumber": 3,
            "adsPerBreak": 3,
            "timeLimit": {
              "enabled": true,
              "seconds": 60
            }
          },
          {
            "midrollBreakNumber": 5,
            "adsPerBreak": 4,
            "timeLimit": {
              "enabled": true,
              "seconds": 80
            }
          }
        ]
      }
    },
    "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

By default, insertion policies are ranked in order of creation, with the most recent ones at the bottom (ranked lowest). Use this endpoint to mark the order in which Pulse should pick insertion policies when more than one insertion policy matches the tag targeting, category targeting, or both tag and category targeting coming in the ad request. In this case, the insertion policy with the highest rank gets selected.

Pulse looks at all insertion policies from top to bottom and picks the first one whose specified targeting matches the parameters sent in the ad request. It looks at the parent categories as well, so that all sub-categories of the categories specified in the insertion policy are considered matched.

Method PUT
URL https://api.videoplaza.com/v1/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 /v1/insertion-policy/rank HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body

{
  "ids": [
    "9bb46636-b75d-4d65-9ab1-8fb21bb45871"
  ],
  "idAfter": "289ebaf9-0742-4bb9-a688-cf2c95425260"
}

Success response

HTTP status:
  200 (OK)

Delete an Insertion Policy

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

HTTP status: 204 No Content

Header: -

Body: -

Example

Request header

DELETE /v1/insertion-policy/9bb46636-b75d-4d65-9ab1-8fb21bb45871 HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response

HTTP status:
  204 (No Content)