Retrieving results for a VAST tag
VAST analysis involves XML validation followed by video asset processing. A VAST tag can return different content on subsequent calls (variations), and each response can reference multiple video files. Retrieving the full scan results may require several API calls. This guide covers the steps involved.
Prerequisites
Section titled “Prerequisites”You need a campaign with VAST creatives that have already been processed. Make sure you can see results in the Advalidation UI before trying to fetch them via the API.
Overview
Section titled “Overview”The general flow is:
- List creatives in your campaign from
/campaigns/{campaignId}/creatives - Check for
nbVariationson each creative - If
nbVariationsis present, use the variations route to get per-variation results (which includes media files) - If no
nbVariations, fetch media files from/creatives/{creativeId}/media-filesand get scan results for each - Fetch test results from
/scans/{scanId}for every scan ID discovered
See the data model for the full hierarchy and decision logic.
Step 1: Find the campaign
Section titled “Step 1: Find the campaign”Use /campaigns to retrieve your campaigns and find the one you need. Note the id — this is your campaignId.
Step 2: List campaign creatives
Section titled “Step 2: List campaign creatives”Use /campaigns/{campaignId}/creatives to list the creatives. The key fields are:
| Field | Description |
|---|---|
id | The creative ID |
name | Creative name |
nbVariations | Number of VAST variations (only present if the tag returns varying responses) |
latestScanStatus.id | The scan ID for retrieving test results |
latestScanStatus.nbIssues | Number of failing tests |
What you do next depends on whether the creative has nbVariations:
- Has
nbVariations— the VAST tag returns different content on subsequent calls. The top-level scan (latestScanStatus.id) containsnbIssuesas an aggregate count but notestsarray. The actual test results live on the variations. Go to Step 3a: Variations. - No
nbVariations— the creative’slatestScanStatus.idgives you the VAST XML scan with test results. To get video file results, go to Step 3b: Media files.
Step 3a: Variations
Section titled “Step 3a: Variations”When Advalidation detects that a VAST tag returns varying responses, it records each variation separately.
1. List variations using /creatives/{creativeId}/variations:
Note the creativeId for each variation.
2. Get variation details using /creatives/{mainCreativeId}/variations/{variationCreativeId}. For example, /creatives/53/variations/111:
The response includes:
- Items with
sourceType: "vast-variation"— the VAST XML analysis for this variation - Items with
sourceType: "vast-child-video"— each video media file referenced in the tag
Use latestScanStatus.id from each item to fetch the test results.
Step 3b: Media files
Section titled “Step 3b: Media files”For VAST creatives without variations, each media file referenced in the tag has its own scan. Fetch them using /creatives/{creativeId}/media-files:
Use latestScanStatus.id from each media file to fetch test results. You can also fetch results for the VAST XML itself using latestScanStatus.id from the parent creative (step 2).
Step 4: Fetch test results
Section titled “Step 4: Fetch test results”Use /scans/{scanId} to get the test results for any scan ID obtained in the previous steps:
See The test array for a reference of all available tests and their fields.
Retrieving the ad specification
Section titled “Retrieving the ad specification”Each campaign has an associated ad specification that defines which tests are run and their expected values. You can retrieve it using the adspecId from the campaign object.
Use /ad-specifications/{adspecId}:
The conditionsString field shows the human-readable expected value for each test. The evaluationExpression field contains the evaluation logic in JsonLogic format — this is what Advalidation uses internally to determine pass or fail. Some tests (like Test_Video_VastCreativeCount) have no configurable parameters and will not include these fields.