Create an Insights report
Create an Insights report with this in-depth tutorial using IQM's API.
The following endpoints are used to check campaigns for eligibility and create different types of Insights reports:
POSTGET
GET
POST
POST
POST
POST
POST
POST
POST
About IQM Insights
Insights reports are one of IQM's analytics tools that help Advertisers quickly identify trends and apply precise adjustments to deliver better results for campaigns. With pre-defined metrics and dimensions, Insights reports can be generated for the following areas:
- Campaign Bidding Insights reports capture rejected campaigns and segment them based on rejection reason, allowing you to assess which parameters are limiting a campaign's success.
- Audience Insights reports provide an in-depth view of audience characteristics, interests, and behaviors to give you a deeper understanding of your target audience and create targeted and personalized advertising strategies.
- Voter Level Data (VLD) Insights reports offer information about targeting in current or prior political campaigns. These reports include ad exposure, engagement data, demographic data, and voting-history details by voter.
- Provider Level Data (PLD) Insights reports include details about healthcare professionals targeted in your campaigns, and provide similar details as VLD Insights reports while adhering to healthcare data privacy regulations.
More resources
- Campaign Bidding Insights reports Help Center article
- Audience Insights reports Help Center article
- Voter Level Data (VLD) Insights reports Help Center article
- Provider Level Data (PLD) Insights reports Help Center article
- Insights API guidelines
Before you begin
To generate an Insights report, you need an account on the IQM platform (see Getting started). Once you have an account you can log in and review the eligibility requirements table for each kind of Insights report.
Log in
POSTTo log in, the Authentication: Basic header is required. The Login API returns an OAuth-compliant response with an Organization Workspace ID (owId), a unique identifier for each Organization. This ID is used for any further API communications.
For further information see OAuth token.
| Headers | |
|---|---|
Authentication string required | Authentication bearer token. See Sign up and authenticate |
| Request schema | |
|---|---|
grant_type string required | password for login OAuth Grant Types |
username string required | User account email |
password string required | User account password |
- JSON
curl -i --location 'https://api.iqm.com/api/v3/ua/oauth/token' \
--header 'accept: application/json, text/plain, */*' \
--header 'Authorization: Basic <Client ID/Client Secret>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=user@iqm.com' \
--data-urlencode 'password=<your password>'
{
"success": true,
"data":
{
"access_token": "106adb25-37b0-4cab-8381-d682fe7cc3c8",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64",
"scope": "read write",
"token_type": "bearer",
"expires_in": 35999,
"owId": 200001
}
}
More responses
{
"success": false,
"data":
{
"status": "On Hold",
"reason": "The particular account is kept on hold due to missed payment dates for last 3 months.",
"supportEmail": "support@iqm.com"
},
"errorObjects":
[
{
"error": "User is not allowed to access provided customer",
"reason": "User is not associated with any active organization."
}
]
}
{
"success": false,
"errorObjects":
[
{
"error": "User doesn't exist or user is not allowed to provided workspace."
}
]
}
Authentication
Use the following header parameters for all requests after logging in:
| Headers | |
|---|---|
Authentication string required | Authentication bearer token See Sign up and authenticate |
X-IAA-OW-ID integer required | Organization Workspace ID Header |
Eligibility requirements
The table below outlines the eligibility requirements for each Insights report type and includes relevant resources. Click on a type to jump to the instructions for generating that Insights report.
| Type | Requirements | Resources |
|---|---|---|
| Campaign Bidding Insights report | Campaign requirements:
| Campaign API guidelines Create new campaign Campaign status type ID Campaign type ID |
| Audience Insights report | Audience requirements:
| Upload a Matched audience Audience API guidelines Audience status type ID Audience type ID |
| VLD Insights report | Campaign requirements:
| |
| PLD Insights report | Campaign requirements:
| ABM audience details |
Campaign Bidding Insights report
Step 1: Check campaign for eligibility
GETTo generate a Campaign Bidding Insights report, use the campaignId and the Get campaign details endpoint to check if the eligibility requirements are met.
The endpoint returns a JSON schema of campaign details; the relevant parameters are highlighted in the sample Response 200 code block. A campaign type of 1 means it's an "advanced" campaign. In the sample response the status is running, and the impressions count is 5. This campaign meets the eligibility requirements to generate an Insights report.
| Path parameters | |
|---|---|
| campaignId integer | Campaign ID |
- JSON
- TypeScript
{
"statusCode": 200,
"responseObject": {
"owId": 203578,
"parentOrganizationName": "Signup testing 1",
"id": 537599,
"uowId": 188494,
"campaignName": "TestCampaign",
"advertiserDomain": "https://iqm.com",
"creativeType": 11,
"campaignType": 1,
"totalBudgetPacing": true,
"isTvAd": false,
"budgetDay": 1199.08,
"budgetTotal": 50000.0,
"maxBid": 15.0,
"timezone": 29,
"startTime": 1726518001,
"endTime": 1727668800,
"status": "running",
"dspMargin": 0,
"platformMargin": 0,
"userDealMargin": 0,
"spentScale": false,
"creativeIds": "676384",
"conversionType": "None",
"bidOptimization": true,
"bidPacing": true,
"isBidShading": false,
"impressionCapping": 0,
"maxDayImpressions": 0,
"maxDayClicks": 0,
"maxDayConversions": 0,
"totalImpressions": 5,
"totalClicks": 0,
"totalConversions": 0,
"deviceType": "13,15,11,12",
"trafficType": "11,12",
"exchanges": "",
"isLocationWithOrFilter": true,
"countryId": "30100001",
"locationDetails": {},
"isCampaignFromNewPlatform": true,
"organizationName": "User's Org",
"userEmail": "User@iqm.com",
"userName": "User",
"conversionTypeId": 0,
"isUnapprovedAudienceTargeted": false,
"isAllAudienceUnapproved": false,
"createDate": 1726517360,
"ioId": 15844,
"ioName": "Test2",
"prebidAudienceSegmentIdList": [],
"campaignTypeId": 1,
"budgetTypeId": 1,
"isAdvanceAudioVideoTargeted": false,
"isEstimatorAvailable": true,
"isEditAccess": true,
"isMarginSet": false,
"isApprovalAccess": false,
"isParentInvoiceTemplateSet": true
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
statusCode: number;
responseObject: {
owId: number;
parentOrganizationName: string;
id: number;
uowId: number;
campaignName: string;
advertiserDomain: string;
creativeType: number;
campaignType: number;
totalBudgetPacing: boolean;
isTvAd: boolean;
budgetDay: number;
budgetTotal: number;
maxBid: number;
timezone: number;
startTime: number;
endTime: number;
status: string;
dspMargin: number;
platformMargin: number;
userDealMargin: number;
spentScale: boolean;
creativeIds: string;
conversionType: string;
bidOptimization: boolean;
bidPacing: boolean;
isBidShading: boolean;
impressionCapping: number;
maxDayImpressions: number;
maxDayClicks: number;
maxDayConversions: number;
totalImpressions: number;
totalClicks: number;
totalConversions: number;
deviceType: string;
trafficType: string;
exchanges: string;
isLocationWithOrFilter: boolean;
countryId: string;
locationDetails: {}
isCampaignFromNewPlatform: boolean;
organizationName: string;
userEmail: string;
userName: string;
conversionTypeId: number;
isUnapprovedAudienceTargeted: boolean;
isAllAudienceUnapproved: boolean;
createDate: number;
ioId: number;
ioName: number;
prebidAudienceSegmentIdList: number[];
campaignTypeId: number;
budgetTypeId: number;
isAdvanceAudioVideoTargeted: boolean;
isEstimatorAvailable: boolean;
isEditAccess: boolean;
isMarginSet: boolean;
isApprovalAccess: boolean;
isParentInvoiceTemplateSet: boolean;
}
}
}
}
}
function getCampaign(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v2/cmp/campaign/{campaignId}',
params: {
query?: {
isSpentRequired?: `boolean`,
},
path: {
campaignId: `number`
}
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 2: Generate Campaign Bidding Insights report
GETOnce a campaign is determined eligible, you can generate a Campaign Bidding Insights report. Pass the campaignId in the endpoint's path and use the query parameters to specify the date range of the report (maximum two weeks).
This endpoint returns a list of rejection reasons for why the campaign's bid requests were dropped. The number of bids won is also returned.
| Path parameters | |
|---|---|
campaignId integer | Campaign ID |
| Query parameters | |
|---|---|
dateRangeStart integer | Unix epoch timestamp, in milliseconds |
dateRangeEnd integer | Unix epoch timestamp, in milliseconds |
Response properties
rejectionListobject | List of bid rejection reasons | ||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
campaignSettings object | Campaign settings | |||||||||
ioBudget object | IO budget | |||||||||
inventoryTargeting object | Inventory targeting | |||||||||
campaignBidPrice object | Campaign bid price | |||||||||
locationTargeting object | Location targeting | |||||||||
deviceTargeting object | Device targeting | |||||||||
creativeSettings object | Creative settings | |||||||||
advanceTargeting object | Advanced targeting | |||||||||
audienceTargeting object | Audience targeting | |||||||||
bidStrategy object | Bid strategy | |||||||||
campaignBudget object | Campaign budget | |||||||||
demographicsTargeting object | Demographics targeting | |||||||||
undefined object | Undefined | |||||||||
| ||||||||||
title string | Object title |
rejectedBids integer | Rejected bids count |
description string | description |
subReasonInfo object | List of sub-reasons info |
topMainReasons object
topSubReasons object
totalBids integer
lostBids integer
totalWins integer
subReasonInfo object properties
inactiveAccount | Bids dropped off because Advertiser's account with IQM is inactive |
insufficientBalance | Bids dropped off because there is an insufficient balance in your account |
creativeRollPosition | Bids dropped off because the roll position (pre-, mid-, post-roll) didn't match the campaign's required roll position |
creativePlayerSize | Bids dropped off because player size did not match campaign's required player size |
ioBudget | Bids dropped off because budget on the campaign's associated IO has spent in full |
audienceUnavailable | Bids dropped off because audience did not match campaign's Audience targeting parameters |
creativeUnavailable | Bids dropped off due to the campaign's creative settings, such as creative type, dimensions, duration and others |
campaignBidPrice | Bids dropped off because the bid price is lower than the floor price recived from the exchange |
operatingSystem | Bids dropped off because Operating System did not match the campaign's Operating System requirements |
manufacturer | Bids dropped off because the Manufacturer did not match the campaign's Manufacturer parameters |
deviceType | Bids dropped off because the Device Type did not match the campaign's Device Type targeting parameters |
channels | Bids dropped off because Channels did not match the campaign's Channel Targeting Parameters |
networkTypes | Bids dropped off because Network Type did not match the campaign's Network Type requirements |
carrier | Bids dropped off because Carrier did not match the campaign's Carrier requirements |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRequests": 100,
"rejectionList": {
"campaignSettings": {
"title": "Campaign Settings",
"rejectedBids": 0,
"description": "Campaign is filtered due to Campaign Settings set in the campaign.",
"subReasonInfo": {}
},
"ioBudget": {
"title": "IO Budget",
"rejectedBids": 0,
"description": null,
"subReasonInfo": {}
},
"inventoryTargeting": {
"title": "Inventory Targeting",
"rejectedBids": 0,
"description": "Campaign is filtered due to Inventory Targeting.",
"subReasonInfo": {}
},
"campaignBidPrice": {
"title": "Campaign Bid Price",
"rejectedBids": 0,
"description": "Campaign is filtered because the bid price is lower than the floor price received from the exchange.",
"subReasonInfo": {}
},
"locationTargeting": {
"title": "Location Targeting",
"rejectedBids": 0,
"description": "Campaign is filtered due to Location Targeting.",
"subReasonInfo": {}
},
"deviceTargeting": {
"title": "Device Targeting",
"rejectedBids": 0,
"description": "Campaign is filtered due to Device Targeting.",
"subReasonInfo": {}
},
"creativeSettings": {
"label": "Creative Settings",
"rejectedBids": 100,
"description": "Campaign is filtered due to non-matching creative dimensions found in the request",
"subReasonInfo": {
"creativeDimension": {
"label": "Creative Dimensions",
"droppedRequests": 100,
"description": "Campaign is filtered due to non-matching creative dimensions found in the request."
}
}
},
"advanceTargeting": {
"title": "Advanced Targeting",
"rejectedBids": 0,
"description": null,
"subReasonInfo": {}
},
"audienceTargeting": {
"title": "Audience Targeting",
"rejectedBids": 0,
"description": "Campaign is filtered due to Audience Targeting.",
"subReasonInfo": {}
},
"bidStrategy": {
"title": "Bid Strategy",
"rejectedBids": 0,
"description": "Campaign is filtered due to bid strategy setting applied in campaign.",
"subReasonInfo": {}
},
"campaignBudget": {
"title": "Campaign Budget",
"rejectedBids": 0,
"description": "Campaign is filtered because the campaign budget is now unavailable for further bidding.",
"subReasonInfo": {}
},
"demographicsTargeting": {
"title": "Demographics Targeting",
"rejectedBids": 0,
"description": "Campaign is filtered due to Demographics Targeting.",
"subReasonInfo": {}
},
"undefined": {
"title": "Undefined",
"rejectedBids": 0,
"description": "Campaign is filtered due to Undefined reasons.",
"subReasonInfo": {}
}
},
"topMainReasons": {
"creativeSettings": 100
},
"topSubReasons": {
"creativeDimension": 100
},
"totalBids": 0,
"lostBids": 0,
"totalWins": 0
}
}
{
"success": false,
"errorObjects": [
{
"error": "Date Range End must be greater than Date Range Start"
}
]
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalRequests: number;
rejectionList: {
campaignSettings: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
ioBudget: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
inventoryTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
campaignBidPrice: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
locationTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
deviceTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
creativeSettings: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {
creativeDimension: {
label: string;
droppedRequests: number;
description: string;
}
}
};
advancedTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
audienceTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
bidStrategy: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
campaignBudget: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
demographicsTargeting: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
};
undefined: {
title: string;
rejectedBids: number;
description: string;
subReasonInfo: {}
}
};
topMainReasons: {
creativeSettings: number
};
topSubReasons: {
creativeSettings: number
};
totalBids: number;
lostBids: number;
totalWins: number;
}
}
};
};
422: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string;
}[]
}
};
};
};
function getCampaignBiddingInsight(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/campaign/bid-insights/{campaignId}',
params: {
query: {
dateRangeStart: `number`,
dateRangeEnd: `number`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Audience Insights report
Step 1: Check for eligible audiences
GETTo generate an Audience Insights report, first use this endpoint to retrieve a list of eligible audiences.
| Query parameters | |
|---|---|
searchField string | Filter results by search field |
pageSize integer | Number of entries returned per page, default: 20 |
pageNo integer | Page number of retrieved data |
sortBy string | Sorts by ascending (+) or descending (-), default: -id |
Response properties
insightsData object | Insights data details | |||||||||
| ||||||||||
id integer | Audience ID |
audienceName string | Audience name |
matchRate integer | The percentage of matched records compared to a reference set |
uniques integer | Count of unique audiences reached |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 10,
"filteredRecords": 3,
"insightsData": [
{
"id": 12345,
"audienceName": "audience1",
"matchRate": 58.99,
"uniques": 52432
},
{
"id": 12365,
"audienceName": "audience2",
"matchRate": 78.88,
"uniques": 72786
},
{
"id": 12376,
"audienceName": "audience3",
"matchRate": 34.88,
"uniques": 31122
}
]
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalRecords: number;
filteredRecords: number;
insightsData: {
id: number;
audienceName: string;
matchRate: number;
uniques: number;
}[]
}
}
};
};
};
function getInsightsCreateEligibleAudienceList(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/audiences/list',
params: {
query?: {
searchField?: `string`,
pageSize?: `number`,
pageNo?: `number`,
sortBy?: `string`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 2: Generate Audience Insights report
POSTPass the audience id (from the response data in step 1) in the Source IDs array to generate the Audience Insights report with this endpoint.
| Request schema | |
|---|---|
insightsTypeId integer | Insights type ID |
sourceIds integer | Source IDs |
Response properties
invalidSourceIds array of integers | Invalid source IDs list | |||||||||||||||
insightsData object | Insights data details | |||||||||||||||
| ||||||||||||||||
id integer | Audience Insights ID |
typeId integer | Insights type ID |
statusId integer | Insights status ID |
sourceName string | Source name |
name string | Insights name |
sourceId integer | Source ID |
createdAtinteger | Unix epoch timestamp of Insights creation date, in milliseconds |
- JSON
- TypeScript
{
"insightsTypeId": 1,
"sourceIds": [
567895,
925436,
123677
]
}
{
"success": true,
"data": {
"invalidSourceIds": [],
"insightsData": [
{
"id": 1213,
"typeId": 1,
"statusId": 2,
"sourceName": "Data Trust NY 4 Cols",
"name": "Data Trust NY 4 Cols_insights",
"sourceId": 1099461,
"createdAt": 1728366883518
}
]
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
invalidSourceIds: number[];
insightsData: {
id: number;
typeId: number;
statusId: number;
sourceName: string;
name: string;
sourceId: number;
createdAt: number;
}[]
}
}
};
};
};
function createInsightsDetails(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/insights/add',
requestBody: {
content: {
"application/json": {
insightsTypeId?: `number`,
sourceIds?: `array of numbers`,
owId?: `number`,
uowId?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 3: Download Audience Insights report
POSTPass the Insights id (from the response data in step 2) in the insightsId query, along with your desired file type, to generate a download link for your Audience Insights report.
| Query parameters | |
|---|---|
insightsId integer | Insights ID |
fileType string | File type of Report: pdf or xlsx |
| Request schema | |
|---|---|
customLogoFile string | Multipart/form-data format |
Response properties
insightsReportUrl string | Audience Insights report URL |
- JSON
- TypeScript
{
"customLogoFile": "string"
}
{
"success": true,
"data": {
"insightsReportUrl": "https://domain.com/insights.pdf"
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
insightsReportUrl: string;
}
}
};
};
};
function downloadInsights(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/insights/download',
params: {
query: {
insightsId: `number`,
fileType: `string`
}
},
requestBody?: {
content: {
"application/json": {
customLogoFile?: `string`
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
VLD Insights report
Step 1: Check campaign for eligibility
GETTo generate a VLD Insights report, first use the campaignId and the Get campaign details endpoint to check if the eligibility requirements are met.
The endpoint returns a JSON schema of campaign details (the relevant parameters are highlighted in the sample Response 200 code block):
- The status is running.
- createDate indicates when the campaign was created (in Unix epoch milliseconds).
- startTime and endTime indicate the campaign's duration.
- A Country ID of 30100001 indicates the targeted audience is in the US.
| Path parameters | |
|---|---|
| campaignId integer | Campaign ID |
- JSON
- TypeScript
{
"statusCode": 200,
"responseObject": {
"owId": 203578,
"parentOrganizationName": "Signup testing 1",
"id": 537599,
"uowId": 188494,
"campaignName": "TestCampaign",
"advertiserDomain": "https://iqm.com",
"creativeType": 11,
"campaignType": 1,
"totalBudgetPacing": true,
"isTvAd": false,
"budgetDay": 1199.08,
"budgetTotal": 50000.0,
"maxBid": 15.0,
"timezone": 29,
"startTime": 1726518001,
"endTime": 1727668800,
"status": "running",
"dspMargin": 0,
"platformMargin": 0,
"userDealMargin": 0,
"spentScale": false,
"creativeIds": "676384",
"conversionType": "None",
"bidOptimization": true,
"bidPacing": true,
"isBidShading": false,
"impressionCapping": 0,
"maxDayImpressions": 0,
"maxDayClicks": 0,
"maxDayConversions": 0,
"totalImpressions": 5,
"totalClicks": 0,
"totalConversions": 0,
"deviceType": "13,15,11,12",
"trafficType": "11,12",
"exchanges": "",
"isLocationWithOrFilter": true,
"countryId": "30100001",
"locationDetails": {},
"isCampaignFromNewPlatform": true,
"organizationName": "User's Org",
"userEmail": "User@iqm.com",
"userName": "User",
"conversionTypeId": 0,
"isUnapprovedAudienceTargeted": false,
"isAllAudienceUnapproved": false,
"createDate": 1726517360,
"ioId": 15844,
"ioName": "Test2",
"prebidAudienceSegmentIdList": [],
"campaignTypeId": 1,
"budgetTypeId": 1,
"isAdvanceAudioVideoTargeted": false,
"isEstimatorAvailable": true,
"isEditAccess": true,
"isMarginSet": false,
"isApprovalAccess": false,
"isParentInvoiceTemplateSet": true
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
statusCode: number;
responseObject: {
owId: number;
parentOrganizationName: string;
id: number;
uowId: number;
campaignName: string;
advertiserDomain: string;
creativeType: number;
campaignType: number;
totalBudgetPacing: boolean;
isTvAd: boolean;
budgetDay: number;
budgetTotal: number;
maxBid: number;
timezone: number;
startTime: number;
endTime: number;
status: string;
dspMargin: number;
platformMargin: number;
userDealMargin: number;
spentScale: boolean;
creativeIds: string;
conversionType: string;
bidOptimization: boolean;
bidPacing: boolean;
isBidShading: boolean;
impressionCapping: number;
maxDayImpressions: number;
maxDayClicks: number;
maxDayConversions: number;
totalImpressions: number;
totalClicks: number;
totalConversions: number;
deviceType: string;
trafficType: string;
exchanges: string;
isLocationWithOrFilter: boolean;
countryId: string;
locationDetails: {}
isCampaignFromNewPlatform: boolean;
organizationName: string;
userEmail: string;
userName: string;
conversionTypeId: number;
isUnapprovedAudienceTargeted: boolean;
isAllAudienceUnapproved: boolean;
createDate: number;
ioId: number;
ioName: number;
prebidAudienceSegmentIdList: number[];
campaignTypeId: number;
budgetTypeId: number;
isAdvanceAudioVideoTargeted: boolean;
isEstimatorAvailable: boolean;
isEditAccess: boolean;
isMarginSet: boolean;
isApprovalAccess: boolean;
isParentInvoiceTemplateSet: boolean;
}
}
}
}
}
function getCampaign(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v2/cmp/campaign/{campaignId}',
params: {
query?: {
isSpentRequired?: `boolean`,
},
path: {
campaignId: `number`
}
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 1.1: Check campaign audience type
POSTPass the campaignId to check its audience. Audience type ID 1 indicates this campaign has a Matched audience.
| Request schema | |
|---|---|
campaignIds array of integers | Campaign IDs |
Response properties
campaignId object | Name-Value pairs of campaignId and its object properties | |||||
| ||||||
audienceTypeId integer | Audience type ID. |
audienceIds array of integers | Audience IDs |
- JSON
- TypeScript
{
"campaignIds": [
52241,
50322
]
}
{
"success": true,
"data": {
"543363": [],
"553441": [
{
"audienceTypeId": 1,
"audienceIds": [
1101833,
1101834,
1101835,
1102476
]
}
],
"553443": [
{
"audienceTypeId": 1,
"audienceIds": [
1101831,
1101835,
1102476
]
},
{
"audienceTypeId": 9,
"audienceIds": [
1124205,
1124206
]
}
]
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
data: {
[campaignId: number]: {
audienceTypeId: number;
audienceIds: number[];
}
}[];
};
};
};
}
function getAudienceBasicDetailByCampaign(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/cmp/audience/targeting',
requestBody: {
content: {
"application/json": {
campaignIds?: `array of numbers`,
owIds?: `array of numbers`,
isAllOwIds?: `boolean`,
status?: `array of strings`,
creativeTypeIds?: `array of numbers`,
ids?: `array of numbers`,
responseFields?: `array of strings`,
ioIdsList?: `array of numbers`,
campaignTypeIds?: `array of numbers`,
pageNo?: `number`,
noOfEntries?: `number`,
sortBy?: `string`,
searchField?: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 2: Generate VLD Insights report
POSTOnce the desired campaign has been determined eligible, pass the campaignId in the request schema (along with vldStartDate and vldEndDate) to generate a VLD Insights report.
| Request schema | |
|---|---|
vldStartDate integer | Unix epoch timestamp of start date, in milliseconds |
vldEndDate integer | Unix epoch timestamp of end date, in milliseconds |
campaignId integer | Campaign ID |
Response properties
vldReportCreated boolean | Indicates VLD Insights report was created: true |
campaignId integer | Campaign ID |
campaignName string | Campaign name |
campaignStatus string | Campaign status type |
vldStartDateinteger | Unix epoch timestamp of start date, in milliseconds |
vldEndDateinteger | Unix epoch timestamp of end date, in milliseconds |
vldChargeableImps integer | The number of chargeable impressions for the requested VLD Insights report |
vldChargedImps integer | The number of impressions for which the VLD Insights report is already generated |
vldChargeableCost integer | Cost to generate the VLD Insights report |
vldChargedCost integer | Cost of VLD Insights report that is already generated |
fundsAvailable boolean | Indicates if sufficient funds are available in the Advertiser's account to generate the VLD Insights report (true) |
- JSON
- TypeScript
{
"campaignId": 12345,
"vldStartDate": 1722311000,
"vldEndDate": 1722315000
}
{
"success": true,
"data": {
"vldReportCreated": true,
"campaignId": 1,
"campaignName": "Campaign Name",
"campaignStatus": "running",
"vldStartDate": 1722311000,
"vldEndDate": 1722315000,
"vldChargeableImps": 1000,
"vldChargedImps": 100,
"vldChargeableCost": 1000,
"vldChargedCost": 100,
"fundsAvailable": true
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
vldReportCreated: boolean;
campaignId: number;
campaignName: string;
campaignStatus: string;
vldStartDate: number;
vldEndDate: number;
vldChargeableImps: number;
vldChargedImps: number;
vldChargeableCost: number;
vldChargedCost: number;
fundsAvailable: boolean
}
}
};
};
};
function generateVLDReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/vld-report',
requestBody: {
content: {
"application/json": {
campaignId?: `number`,
vldId?: `number`,
vldStartDate?: `number`,
vldEndDate?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 3: Download VLD Insights report
POSTGet a download link for a VLD insight Report in CSV or XLSX format.
| Request schema | |
|---|---|
fileTypeId integer | File type ID XLSX: 1 CSV: 2 |
vldId integer | VLD ID |
Response properties
vldReportUrl string | VLD Insights report file URL |
- JSON
- TypeScript
{
"success": true,
"data": {
"vldReportUrl": "https://tem.domain.s3.amazonaws.com/vld-campaigns/ds/2024-08-20/503481_Insights_1.xlsx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240820T112818Z&X-Amz-"
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
vldReportUrl: string;
}
}
};
};
};
function getVLDReportDownloadUrl(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/vld-report/download',
requestBody: {
content: {
"application/json": {
fileTypeId?: `number`,
vldId?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
PLD Insights report
Step 1: Check campaign for eligibility
GETTo generate a PLD Insights report, first use the campaignId and the Get campaign details endpoint to check if the eligibility requirements are met.
The endpoint returns a JSON schema of campaign details (the relevant parameters are highlighted in the sample Response 200 code block):
- The status is running.
- startTime and endTime indicate the campaign's duration.
| Path parameters | |
|---|---|
| campaignId integer | Campaign ID |
- JSON
- TypeScript
{
"statusCode": 200,
"responseObject": {
"owId": 203578,
"parentOrganizationName": "Signup testing 1",
"id": 537599,
"uowId": 188494,
"campaignName": "TestCampaign",
"advertiserDomain": "https://iqm.com",
"creativeType": 11,
"campaignType": 1,
"totalBudgetPacing": true,
"isTvAd": false,
"budgetDay": 1199.08,
"budgetTotal": 50000.0,
"maxBid": 15.0,
"timezone": 29,
"startTime": 1726518001,
"endTime": 1727668800,
"status": "running",
"dspMargin": 0,
"platformMargin": 0,
"userDealMargin": 0,
"spentScale": false,
"creativeIds": "676384",
"conversionType": "None",
"bidOptimization": true,
"bidPacing": true,
"isBidShading": false,
"impressionCapping": 0,
"maxDayImpressions": 0,
"maxDayClicks": 0,
"maxDayConversions": 0,
"totalImpressions": 5,
"totalClicks": 0,
"totalConversions": 0,
"deviceType": "13,15,11,12",
"trafficType": "11,12",
"exchanges": "",
"isLocationWithOrFilter": true,
"countryId": "30100001",
"locationDetails": {},
"isCampaignFromNewPlatform": true,
"organizationName": "User's Org",
"userEmail": "User@iqm.com",
"userName": "User",
"conversionTypeId": 0,
"isUnapprovedAudienceTargeted": false,
"isAllAudienceUnapproved": false,
"createDate": 1726517360,
"ioId": 15844,
"ioName": "Test2",
"prebidAudienceSegmentIdList": [],
"campaignTypeId": 1,
"budgetTypeId": 1,
"isAdvanceAudioVideoTargeted": false,
"isEstimatorAvailable": true,
"isEditAccess": true,
"isMarginSet": false,
"isApprovalAccess": false,
"isParentInvoiceTemplateSet": true
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
statusCode: number;
responseObject: {
owId: number;
parentOrganizationName: string;
id: number;
uowId: number;
campaignName: string;
advertiserDomain: string;
creativeType: number;
campaignType: number;
totalBudgetPacing: boolean;
isTvAd: boolean;
budgetDay: number;
budgetTotal: number;
maxBid: number;
timezone: number;
startTime: number;
endTime: number;
status: string;
dspMargin: number;
platformMargin: number;
userDealMargin: number;
spentScale: boolean;
creativeIds: string;
conversionType: string;
bidOptimization: boolean;
bidPacing: boolean;
isBidShading: boolean;
impressionCapping: number;
maxDayImpressions: number;
maxDayClicks: number;
maxDayConversions: number;
totalImpressions: number;
totalClicks: number;
totalConversions: number;
deviceType: string;
trafficType: string;
exchanges: string;
isLocationWithOrFilter: boolean;
countryId: string;
locationDetails: {}
isCampaignFromNewPlatform: boolean;
organizationName: string;
userEmail: string;
userName: string;
conversionTypeId: number;
isUnapprovedAudienceTargeted: boolean;
isAllAudienceUnapproved: boolean;
createDate: number;
ioId: number;
ioName: number;
prebidAudienceSegmentIdList: number[];
campaignTypeId: number;
budgetTypeId: number;
isAdvanceAudioVideoTargeted: boolean;
isEstimatorAvailable: boolean;
isEditAccess: boolean;
isMarginSet: boolean;
isApprovalAccess: boolean;
isParentInvoiceTemplateSet: boolean;
}
}
}
}
}
function getCampaign(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v2/cmp/campaign/{campaignId}',
params: {
query?: {
isSpentRequired?: `boolean`,
},
path: {
campaignId: `number`
}
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 1.1: Check campaign audience details
POSTPass the campaignId to check its audience. Audience type ID 1 indicates this campaign has a Matched audience.
| Request schema | |
|---|---|
campaignIds array of integers | Campaign IDs |
Response properties
campaignId object | Name-Value pairs of campaignId and its object properties | |||||
| ||||||
audienceTypeId integer | Audience type ID. |
audienceIds array of integers | Audience IDs |
- JSON
- TypeScript
{
"campaignIds": [
52241,
50322
]
}
{
"success": true,
"data": {
"543363": [],
"553441": [
{
"audienceTypeId": 1,
"audienceIds": [
1101833,
1101834,
1101835,
1102476
]
}
],
"553443": [
{
"audienceTypeId": 1,
"audienceIds": [
1101831,
1101835,
1102476
]
},
{
"audienceTypeId": 9,
"audienceIds": [
1124205,
1124206
]
}
]
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
data: {
[campaignId: number]: {
audienceTypeId: number;
audienceIds: number[];
}
}[];
};
};
};
}
function getAudienceBasicDetailByCampaign(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/cmp/audience/targeting',
requestBody: {
content: {
"application/json": {
campaignIds?: `array of numbers`,
owIds?: `array of numbers`,
isAllOwIds?: `boolean`,
status?: `array of strings`,
creativeTypeIds?: `array of numbers`,
ids?: `array of numbers`,
responseFields?: `array of strings`,
ioIdsList?: `array of numbers`,
campaignTypeIds?: `array of numbers`,
pageNo?: `number`,
noOfEntries?: `number`,
sortBy?: `string`,
searchField?: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 2: Generate PLD Insights report
POSTOnce the desired campaign has been determined eligible, pass the campaignId in the request schema (along with pldStartDate and pldEndDate) to generate a PLD Insights report.
| Request schema | |
|---|---|
pldStartDate integer | Unix epoch timestamp of start date, in milliseconds |
pldEndDate integer | Unix epoch timestamp of end date, in milliseconds |
campaignId integer | Campaign ID |
Response properties
pldReportCreated boolean | Indicates PLD Insights report was created: true |
campaignId integer | Campaign ID |
campaignName string | Campaign name |
campaignStatus string | Campaign status type |
pldStartDateinteger | Unix epoch timestamp of start date, in milliseconds |
pldEndDateinteger | Unix epoch timestamp of end date, in milliseconds |
pldChargeableImps integer | The number of chargeable impressions for the requested PLD Insights report |
pldChargedImps integer | The number of impressions for which the PLD Insights report is already generated |
pldChargeableCost integer | Cost to generate the PLD Insights report |
pldChargedCost integer | Cost of PLD Insights report that is already generated |
fundsAvailable boolean | Indicates if sufficient funds are available in the Advertiser's account to generate the PLD Insights report (true) |
- JSON
- TypeScript
{
"campaignId": 12345,
"pldStartDate": 1722311000,
"pldEndDate": 1722315000
}
{
"success": true,
"data": {
"pldReportCreated": true,
"campaignId": 1,
"campaignName": "Campaign Name",
"campaignStatus": "running",
"pldStartDate": 1722311000,
"pldEndDate": 1722315000,
"pldChargeableImps": 1000,
"pldChargedImps": 100,
"pldChargeableCost": 1000,
"pldChargedCost": 100,
"fundsAvailable": true
}
}
{
"success": true,
"data": {
"pldReportCreated": false,
"message": "PLD Insights can't be generated for this campaign at the moment as another insight with overlapping date range is processing"
}
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
pldReportCreated: boolean;
campaignId: number;
campaignName: string;
campaignStatus: string;
pldStartDate: number;
pldEndDate: number;
pldChargeableImps: number;
pldChargedImps: number;
pldChargeableCost: number;
pldChargedCost: number;
fundsAvailable: boolean
}
}
};
};
}
function generatePLDReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/pld-report',
requestBody: {
content: {
"application/json": {
campaignId?: `number`,
pldId?: `number`,
pldStartDate?: `number`,
pldEndDate?: `number`,
endDate?: `number`,
startDate?: `number`,
id?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Step 3: Download PLD Insights report
POSTGet a download link for a PLD insight Report in CSV or XLSX format.
| Request schema | |
|---|---|
fileType integer | File type ID XLSX: 1 CSV: 2 |
pldId integer | PLD Insights report ID |
Response properties
pldReportUrl string | PLD Insights report file URL |
- JSON
- TypeScript
{
"fileType": 1,
"pldId": 50
}
{
"success": true,
"data": {
"pldReportUrl": "https://dowload.domain.com/pld-reports/20220101/pld-report-1.xlsx"
}
}
More responses
{
"success": false,
"errorObjects": [
{
"error": "Invalid sortBy value."
}
]
}
See TypeScript prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
pldReportUrl: string;
}
}
};
};
}
function getPLDReportDownloadUrl(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/pld-report/download',
requestBody: {
content: {
"application/json": {
fileTypeId?: `number`,
vldId?: `number`,
pldId?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}