Inventory Forecast Requests

Request Body Format

To create inventory forecasts, you need to supply a body to the request with the following format:
Note: All parameters are optional unless explicitly stated.
{
    "formatTypes": [
        "PREROLL",
        "MIDROLL",
        "POSTROLL",
        "SEEKROLL",
        "OVERLAY",
        "COMPANION_BANNER", 
        "PAUSE_AD"
       ],
    "deviceContainers": [     (Valid device container UUID, you can target multiple device containers.)
        "<string>",
        "<string>"
       ],
    "startDate": "<string>",    (Required)
    "endDate": "<string>",      (Required)
    "trafficEstimate": "<integer>",
    "name": "<string>"
    "targeting": {    (The targeting property cannot be omitted)
        "targetingTemplates": "<string>",     (ID of the targeting template),
        "targetingRules": {    (See note below for more information)
            "locationRules": [LocationRuleBean],
            "tagAndPartnerRules": [TagRuleBean or ContentPartnerRuleBean],
            "categoryRules": [CategoryRuleBean],
            "audienceRules": {"<audience data provider id>": AudienceSegmentRuleBean}
            },
         "parentOverrides": {
            "contentRules": "<boolean>",
            "tagAndPartnerRules": "<boolean>",
            "locationRules": "<boolean>",
            "audienceRules": "<boolean>"
            }
      }
}
Note: Setting the FrequencyRuleBean, IpRuleBean, UserAgentRuleBean and TimeRuleBean is currently not supported when creating inventory forecasts. For more information on setting the targeting rules, the available parameters and their values, please refer to Update Targeting Template Rules.

Create an Inventory Forecast Job

Method POST
URL https://api.videoplaza.com/api/2.0/forecast/inventory
Header Authentication header (x-o-api-key)
Content type application/json
URL params -
Query params -
Body Request Body Format
Success response

HTTP status: 202 Accepted

Header: Location: URI to the location of the inventory forecast job

Body: -

Example:

Request header:

POST /api/2.0/forecast/inventory HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body:

{
    "targeting": {
        "targetingTemplates": null,
        "targetingRules": {
            "locationRules": [
                          {
                "locationId": "11358",
                "locationType": "REGION",
                "locationName": "stockholms lan",
                "access": "ALLOW"
                 }
               ],
            "tagAndPartnerRules": [],
            "categoryRules": [
                          {
                "categoryId": "dc74b090-c275-4646-a37f-4d5cff09997a",
                "categoryName": "Entertainment",
                "ruleType": "AT_LEAST_ONE_OF"
                 }
               ],
            "audienceRules": {}
        },
        "parentOverrides": {
            "contentRules": true
        }
    },
    "formatTypes": [
            "COMPANION_BANNER", 
            "OVERLAY", 
            "PREROLL", 
            "PAUSE_AD", 
            "POSTROLL", 
            "MIDROLL", 
            "SEEKROLL"
          ],
    "deviceContainers": [    
            "a6b5b571-c517-4597-861b-24d2d190d642", 
            "27375d12-e3ad-46ce-ad78-eece92928c90", 
            "145299c6-ba02-45de-9995-c2dfaba44c8c"
          ],
    "startDate": 1467756000000,
    "endDate": 1468447199000,
    "trafficEstimate": 150,
    "name": "Inventory Test"
}

Success response:

HTTP status:
    202 (Accepted)

Header:
  Location: <URI with the location of your inventory forecast job>

Check Inventory Forecast Job Status

Method GET
URL https://api.videoplaza.com/api/2.0/forecast/job/{jobId}
Header Authentication header (x-o-api-key)
Content type application/json
URL params ID of the inventory forecast job
Query params -
Body -
Success response

HTTP status: 201 Created

Header: Location: URI to the location of the inventory forecast report

Body: -

Note: Possible HTTP status responses and their meaning:
  • 200 (OK): job has status QUEUED, PREPARING_SIMULATION, PROCESSING or FAILED.
  • 201 (Created): job completed. The location header contains the location of the finished forecast report.
  • 404 (Not Found): no job with the given ID found.

Example:

Request header:

GET /api/2.0/forecast/job/c4c5e81c-eff6-46fe-82c1-06d3c100c7c4 HTTP/1.1
Host: api.videoplaza.com
Content-type: application/json
x-o-api-key="<your key>"

Request body: NA

Success response:

HTTP status:
        201 (Created)  
Header:
  Location: <URI with the location of your inventory forecast report>

Cancel Inventory Forecast Job

Method POST
URL https://api.videoplaza.com/api/2.0/forecast/job/{jobId}/cancel
Header Authentication header (x-o-api-key)
Content type application/json
URL params ID of the inventory forecast job
Query params -
Body -
Success response

HTTP status: 200 OK

Header: -

Body: -

Example:

Request header:

POST /api/2.0/forecast/job/c4c5e81c-eff6-46fe-82c1-06d3c100c7c4/cancel 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)

Get a Finished Inventory Forecast Report

Method GET
URL https://api.videoplaza.com/api/2.0/forecast/report/inventory/{id}
Header Authentication header (x-o-api-key)
Content type application/json
URL params ID of the inventory forecast report
Query params -
Body -
Success response

HTTP status: 200 OK

Header: -

Body: InventoryForecastResultBean

{
    "totalInventory": {
        "total": 0,
        "inventoryByDate": {}
    },
    "unusedInventory": {
        "total": 0,
        "inventoryByDate": {}
    },
    "name": "<string>",
    "jobId": "<string>"
}

Example:

Request header:

GET /api/2.0/forecast/report/inventory/c4c5e81c-eff6-46fe-82c1-06d3c100c7c4 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)  
  
Body:
{
  "totalInventory": {
    "total": 0,
    "inventoryByDate": {
      "2016-07-11T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-09T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-08T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-10T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      }
    }
  },
  "unusedInventory": {
    "total": 0,
    "inventoryByDate": {
      "2016-07-11T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-09T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-08T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      },
      "2016-07-10T00:00:00.000+02:00": {
        "total": 0,
        "inventoryByFormat": {
          "PREROLL": {
            "total": 0
          },
          "MIDROLL": {
            "total": 0
          },
          "POSTROLL": {
            "total": 0
          }
        }
      }
    }
  },
  "name": "Inventory Test",
  "jobId": "c4c5e81c-eff6-46fe-82c1-06d3c100c7c4"
}

해당 내용이 도움 되었습니까?