Insights API
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:
| Type | Description | Notes |
|---|---|---|
| Campaign Bidding Insights | Campaign Bidding Insights capture rejected Campaigns and segment them based on rejection reason, allowing you to assess which parameters are limiting a Campaign’s success. | |
| Audience Insights | Audience Insights provide in-depth Reports of Audience characteristics, interests, and behaviors to give you a deeper understanding of your target Audience and create targeted and personalized advertising strategies. | |
| Audience Quality Score (AQS) | AQS Reports leverage third-party healthcare data from PurpleLab to confirm Audience exposure based on patient-level targeting criteria including prescriptions, diagnoses, and procedures. | |
| Voter Level Data (VLD) | VLD Reports offer Insights about targeting in current or prior political Campaigns. These Reports include ad exposure, engagement data, demographic data, and voting-history details by voter. | |
| ScriptLift Studies (SLS) | SLS Reports include key details about prescribing behaviors and how they are influenced by current and previous healthcare Campaigns. | |
| Provider Level Data (PLD) | PLD Reports include details about healthcare professionals targeted in your Campaigns, and provide similar details as VLD Reports while adhering to healthcare data privacy regulations. | PLD, NLD, and ICT reports are handled by the Report Templates endpoints with the category parameter. |
| Nurse Level Data (NLD) | NLD Reports offer deeper visibility into how Non-NPI nurses engage with your Campaigns. They uncover ad-exposure, engagement, demographic, and physician-specialty data to reveal reach and impact. | |
| Integrated Care Team (ICT) | ICT Reports uncover key details about the ICT Audiences you’ve targeted in previous and current campaigns. |
Some Insights reports will need to be enabled by an administrator to access. By default VLD, PLD, SLS, and AQS reports are not accessible to advertiser users.
You can check an advertiser's access to Insights reports with the Get Customer Config Details endpoint.
More Resources
- Create an Insights Report Tutorial
- Reporting and Analytics Help Center articles
- Audience Quality Insights Reports Help Center articles
- Voter Level Data (VLD) Insights Reports Help Center articles
- Script Lift Study (SLS) Insights Reports Help Center articles
- Provider Level Data (PLD) Insights Reports Help Center articles
- Nurse Level Data (NLD) Insights Reports Help Center articles
- Integrated Care Team (ICT) Insights Reports Help Center articles
Authentication
Use the following header parameters for all requests:
| Headers | |
|---|---|
Authentication string required | Authentication bearer token See Authentication Guide |
X-IAA-OW-ID integer required | Organization Workspace ID Header |
Get Insights Details
Get a List of Insights
GETGet a list of Insights available in the database.
An Insights id can be used to perform various actions in Insights Managment endpoints.
| 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
id integer | Insights ID |
typeId integer | Insights Type ID |
statusId integer | Insights Status ID |
namestring | Insights name |
sourceIdinteger | Insights source ID |
createdAtinteger | Unix epoch timestamp of Insights creation date, in milliseconds |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 1,
"filterRecords": 1,
"insightsData": [
{
"id": 123,
"typeId": 1,
"statusId": 2,
"name": "demo_insights",
"sourceId": 123,
"createdAt": 1687848574780
}
]
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalRecords: number;
filterRecords: number;
insightsData: {
id: number;
typeId: number;
statusId: number;
name: string;
sourceId: number;
createdAt: number
}
}
}
};
};
};
function getInsightsDetailList(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/insights/list',
params: {
query?: {
searchField?: `string`,
pageSize?: `number`,
pageNo?: `number`,
sortBy?: `string`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Campaign Bidding Insights
GETCampaign bidding Insights provides a list of bid rejection reasons for given Campaign ID.
A Campaign must meet the following eligibility criteria to generate bidding Insights:
- More than 1 impression captured
- "running", "expired" (within last two weeks), "paused" status
- Must have been active within the last two weeks
- Campaign Type: "advanced"
| Path Parameters | |
|---|---|
campaignId integer | Campaign ID |
| Query Parameters | |
|---|---|
dateRangeStart integer required | Unix epoch timestamp, in milliseconds |
dateRangeEnd integer required | 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
Bid Rejection Descriptions
| ||||||||||||
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 |
creativeSettings subReasonInfo object properties
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 |
creativeDimension | Bids dropped off due to the size of Creative |
creativeUnavailable | Bids dropped off due to the Campaign's creative settings, such as creative type, dimensions, duration and others |
ioBudgetaudienceUnavailablecampaignBidPriceoperatingSystemdeviceTargeting subReasonInfo object properties
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);
}
Get Insights Count by Type
GETGet a count of Insights by type ID. See List of Insights Type IDs.
Response Properties
data object | Name-Value pairs of insightsTypeId and count |
- JSON
- TypeScript
{
"success": true,
"data": {
"1": 32,
"3": 20
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
[insightsTypeId: number]: number;
}
}
};
};
};
function getInsightsTypeWiseCount(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/insights/type-wise-count',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Eligible Campaigns
GETGet a status-wise list of eligible Campaigns for generation of PLD, ICT, or NLD Insights reports.
Eligible Campaign IDs can be used to in the Calculate Insights Computation and Create Report Template endpoints.
| Query Parameters | |
|---|---|
reportType string required | Type of report: pld, ict, or nld |
Response Properties
running array of objects | Campaigns with running status | |||||
paused array of objects | Campaigns with paused status | |||||
expired array of objects | Campaigns with expired status | |||||
Campaign object properties
| ||||||
- JSON
- TypeScript
{
"success": true,
"data": {
"running": [
{
"campaignId": 451351,
"campaignTimezoneId": 29
}
],
"paused": [
{
"campaignId": 451350,
"campaignTimezoneId": 29
}
],
"expired": [
{
"campaignId": 470839,
"campaignTimezoneId": 29
}
]
}
}
{
"success": false,
"errorObjects": [
{
"error": "Invalid report type provided : vlds"
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
running: {
campaignId: number;
campaignTimezoneId: number;
}[];
paused: {
campaignId: number;
campaignTimezoneId: number;
}[];
expired: {
campaignId: number;
campaignTimezoneId: number;
}[];
}
}
};
};
}
function getEligibleCampaigns(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/insights/eligible-campaigns',
params: {
query: {
reportType: `string`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Calculate Insights Computation
POSTCompute the cost and impressions for creation of PLD, ICT, or NLD Insights reports based on the provided Campaign IDs and date range.
The computation calculates the chargeable impressions and cost based on the markup charged to the organization.
| Request Schema | |
|---|---|
category string required | Insight type category: pld, ict, or nld |
campaignIds array of integers required | Campaign IDs for which to compute the report |
startDate integer required | Unix epoch timestamp of report start date, in milliseconds |
endDate integer required | Unix epoch timestamp of report end date, in milliseconds |
Response Properties
ioId integer | Insertion Order ID |
ioName string | Insertion Order name |
startDate integer | Unix epoch timestamp of report start date, in milliseconds |
endDate integer | Unix epoch timestamp of report end date, in milliseconds |
campaignIds array of integers | Campaign IDs included in the computation |
reportCreatable boolean | Indicates whether the report can be created |
chargeableImps integer | Number of chargeable impressions |
chargedImps integer | Number of already charged impressions |
chargeableCost number | Chargeable cost amount |
chargedCost number | Already charged cost amount |
fundsAvailable boolean | Indicates whether sufficient funds are available |
effectiveRate number | Effective rate for the report |
templateId integer | Associated Template ID |
- JSON
- TypeScript
{
"category": "pld",
"campaignIds": [451351, 451352],
"startDate": 1640995200000,
"endDate": 1643673599000
}
{
"success": true,
"data": {
"ioId": 101,
"ioName": "Test IO",
"startDate": 1742898000000,
"endDate": 1774238399000,
"campaignIds": [11011],
"reportCreatable": true,
"chargeableImps": 100,
"chargedImps": 25,
"chargeableCost": 345.23,
"chargedCost": 45.21,
"fundsAvailable": true,
"effectiveRate": 3.45,
"templateId": 111
}
}
{
"success": false,
"errorObjects": [
{
"error": "Date range is invalid or exceeds maximum allowed period"
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
ioId: number;
ioName: string;
startDate: number;
endDate: number;
campaignIds: number[];
reportCreatable: boolean;
chargeableImps: number;
chargedImps: number;
chargeableCost: number;
chargedCost: number;
fundsAvailable: boolean;
effectiveRate: number;
templateId: number;
}
}
};
};
}
function computeInsightsReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/insights/computation',
requestBody: {
content: {
"application/json": {
category: `string`,
campaignIds: `number[]`,
startDate: `number`,
endDate: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Insights Management
Delete Insights Record
DELETEDelete records from the database for valid Insights IDs passed.
| Query Parameters | |
|---|---|
insightsIds string | Comma separated Insights IDs to delete |
Response Properties
deletedIds array of integers | Deleted Insights records |
invalidIDs array of integers | Invalid IDs |
- JSON
- TypeScript
{
"success": true,
"data": {
"deletedIds": [
35,
34
],
"invalidIds": [
33,
1
]
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
deletedIds: number[];
invalidIds: number[];
}
}
};
};
};
function deleteInsights(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://api.iqm.com/api/v3/ins/insights/delete',
params: {
query: {
insightsId: `array of numbers`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Regenerate Insights Report
POSTRegenerates an Insights Report.
| Path Parameters | |
|---|---|
insightsIds string | Comma separated Insights IDs to regenerate |
Response Properties
success boolean | Indicates Insights Report was succesfully regenerated: true |
data string | Success message |
- JSON
- TypeScript
{
"success": true,
"data": "Insights regenerated successfully."
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string;
}
};
};
};
function regenerateInsights_1(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://api.iqm.com/api/v3/ins/insights/regenerate/{insightsId}',
params: {
path: {
insightsId: `number`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Send Insights Email
POSTSend an attached Insights Report file via email.
| Query Parameters | |
|---|---|
id integer | Insights ID |
attachmentType string | File type of Report: pdf or xlsx |
recipientEmails string | Comma separated string of emails to send Insights Report to, up to 15 |
| Request Schema | |
|---|---|
file string | Multipart/form-data format |
Response Properties
success boolean | Indicates Insights email was succesfully sent: true |
data string | Success message |
- JSON
- TypeScript
{
"file": "string"
}
{
"success": true,
"data": "Insights-1 pdf email sent successfully."
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function sendInsightsEmail(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/send-email',
params: {
query: {
id: `number`,
attachmentType: `string`,
recipientEmails: `string`,
},
},
requestBody?: {
content: {
"application/json": {
file?: `string`
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Audience Insights
Get a List of Eligible Audiences
GETGet a list of Audiences eligible for an Insights Report.
Audiences must have a minimum of 10,000 uniques to be eligible for Insights Report generation.
| 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);
}
Get Matched Audience Details
GETGet matched Audience details by Audience ID.
| Path Parameters | |
|---|---|
audienceId integer | Audience ID |
Response Properties
matchedAudienceData object | Matched Audience Insights details | |||||||||||||||||
| ||||||||||||||||||
audienceName string | Audience name |
matchRate integer | The percentage of matched records compared to a reference set |
uniques integer | Count of unique Audiences reached |
createdDate integer | Unix epoch timestamp of Audience Insights creation date, in milliseconds |
fileTotalCount integer | Total number of records in the uploaded Audience file |
dataCost integer | Fees charged by the platform if the Audience is used in any Campaign |
audienceStatusName string | Audience status |
s3FileName string | S3 file name |
- JSON
- TypeScript
{
"success": true,
"data": {
"matchedAudienceData": {
"audienceName": "Data Trust NY 4 Cols",
"matchRate": 90.0,
"uniques": 90,
"createdDate": 1728010319,
"fileTotalCount": 100,
"dataCost": 2.0,
"audienceStatusName": "Ready",
"s3FileName": "1728010319692_DataTrust_NY_4_Cols.csv"
}
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
matchedAudienceData: {
audienceName: string;
matchRate: number;
uniques: number;
createdDate: number;
fileTotalCount: number;
dataCost: number;
audienceStatusName: string;
s3FileName: string;
}
}
}
};
};
};
function getMatchedAudienceDetailsByAudienceId(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/audience/matched/{audienceId}',
params: {
path: {
audienceId: `number`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Matched Audience File URL
GETGet Matched Audience details as a file URL.
| Path Parameters | |
|---|---|
audienceId integer | Audience ID |
Response Properties
audienceFileUrl string | Matched Audience File URL |
- JSON
- TypeScript
{
"success": true,
"data": {
"audienceFileUrl": "https://iqm-data-lake-stage.s3.amazonaws.com/CAM-FILES/Client%3D202029/Audience%3D1099461/1728010319692_DataTrust_NY_4_Cols.csv?response-content-disposition=attachment%3Bfilename%3D1728010319692_DataTrust_NY_4_Cols.csv&response-content-type=application%2Foctet-stream&AWSAccessKeyId=ASIAZSYSEW2IDYRQV256&Signature=bg47k4d9Yr6XEp1%2B2AiQpG6UsH8%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEDwaCXVzLWVhc3QtMSJIMEYCIQDZQ0HdONURAdKClNDJtsxRy2Q%2FuhAVl8j8mkg%2BYySOXAIhALLGdASViJ%2BjqGbMUOeNGVzSKJmWlO4Rndg9%2FwYMeFCvKoQECKT%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQAhoMNjU4Nzc4NjY2NjQwIgxTA4EPtZELcoAi5R4q2APj0QWXoTRXCAdw7rbtrcGELFLafSFSWkvl2TlAs%2BIXPNNRwL2y2ymFrmlCOxqFCs9DTWR%2FMRvZMmn7CiN%2ByOPem4C8Rp%2BKE6VSTBeMvQrjQIl1l3S0NxluwzOuBiv%2FA2q0%2F2ehoIPkOOl0ecoghzO8%2FZFVPvVjJkWCnm6c8x2MubJXVYZdiOWd2MHaUmMzsIRlvvl4s30JW9iNnHyOdIyHf6JQ2FbYmKSX4SVEPrv7j7kUv3Vr2iffNE%2BQfGYNtQLr7Yu6yjXpko6N6oZ0BpKsw%2BmwgywN%2FWgPBOQUcwZsexrjBkN9%2BMfRWwOKRS%2F6mn80VYRNV%2F2bA0jDzUBVUmATCjmPFx2tovoveIbb7dwm627ulG0yAkJYx4pvn6OFuFQiZ8YMpWd3e9Hdz44Jm01dGZ%2FluW17THYmmIMOmf3UUSSlxjHm6MuzfULBmspjtAFi5apazS8zUVxwMaK2UfcRkWV%2FQjvziaEHNdaI%2FEStWpzz8E9KRApKtPTsU%2BeXtv2ol1O1Z4GgKOqWRquxqr0qD7rwBX2UjE1Vwp86zcQAxZSj84Uqy%2BqVdh1HUX037Tnpt5DIu9zeHQLHDV2KtH9swuDZyjiNa3z8Mmt%2BSO%2F5wzxOgo8srPyYMIyO3rgGOqQBlVBy4y2GJAjMy2fEyseApwBtfXxXtvcet2hHcTZma1iyMjNL9u92XgsVjHY89iBT4cFAfrTn5c8lswph9%2FKyTm%2FoOQpoxPmkoKD5qs1TCuBFXFXMp4d2Clb%2FUkSmqS01aiEkX1%2FrkAF3klbwrC1%2FUKR6%2BaMAahquyYXskHrlqwBHQ9oizw64rkXNIZeSlbfajnNTVmTkhh3QqyEJw9CYZTNN4hk%3D&Expires=1729596011"
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
audienceFileUrl: string
}
}
};
};
};
function downloadMatchedAudienceFile(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/audience/matched/download/{audienceId}',
params: {
path: {
audienceId: `number`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Create Audience Insights
POSTCreate an Insights Report for a given Audience ID.
Check the List of Eligible Audiences and Matched Audience Details endpoints for eligibile Audiences.
An Audience must meet the following eligibility criteria to generate Insights report:
- Must be Matched Audience type
- Audience status: "ready"
- Audience reach: 10,000+
- (Recommended) Audience creation date within the last year
| Request Schema | |
|---|---|
insightsTypeId integer | Insights Type ID |
sourceIds integer | Source IDs (E.g. Audience 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);
}
Download Insights Report
POSTDownload Insights Report for Audience (pdf or xlsx) by passing multipart/form-data format.
| 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 | 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);
}
Audience Quality Score Reports
AQS Eligibility Requirements
AQS Reports are available for Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Healthcare | Any Campaign created under a healthcare advertiser account is a “Healthcare” campaign. |
| Audience type | Matched (Patient), Segmented (Patient) | |
| Audience status | Ready | |
| Campaign type | Advanced, and targeting at least one patient Audience | |
| Campaign status | Running, Expired (within the past two years), Paused | |
| Campaign impressions | 1K or more impressions | |
| Campaign duration | 14 or more days |
AQS Resource Properties
Resource Properties
reportId integer | AQS Report ID |
reportName string | AQS Report name |
campaignId integer | Campaign ID |
campaignName string | Campaign name |
statusId integer | AQS Status Type ID |
statusName string | AQS Status name |
startDate integer | Unix epoch timestamp of start date, in seconds |
endDate integer | Unix epoch timestamp of end date, in seconds |
ioId integer | Insertion Order ID |
ioName string | Insertion Order name |
ioBudgetType integer | Insertion Order Budget Type ID |
isCampaignEligible boolean | Indicates that Campaign is eligible for AQS Report: true |
reportCreatedOn integer | Unix epoch timestamp of creation date, in seconds |
creativeTypeId integer | Creative Type ID |
campaignTimeZoneId integer | Timezone ID |
fileSizeDetails object | Object containing file sizes by type ID (1: XLSX, 2: CSV) |
aqsReportCreatable boolean | Indicates if AQS Report can be generated for the given Campaign and date range (true) |
aqsChargeableImps integer | The number of chargeable impressions for the requested AQS Report |
aqsChargedImps integer | The number of impressions for which the AQS Report is already generated |
aqsChargeableCost number | Cost to generate the AQS Report |
aqsChargedCost number | Cost of AQS Report that is already generated |
fundsAvailable boolean | Indicates if sufficient funds are available in the Advertiser's account to generate the AQS Report (true) |
effectiveAqsRate number | The effective rate applied for AQS Report generation |
Get List of AQS Reports
GETGet a paginated list of Audience Quality Score (AQS) Reports with detailed information.
A reportId can be used in the Download AQS Report and Delete AQS Report endpoints.
| Query Parameters | |
|---|---|
searchField string | Filter results by search field |
noOfEntries integer | Number of entries returned per page, default: 200 |
pageNo integer | Page number of retrieved data, default: 1 |
sortBy string | Sorts by ascending (+) or descending (-), default: reportId |
{
"success": true,
"data": {
"totalRecords": 10,
"reportDataList": [
{
"reportId": 10,
"reportName": "530667_AQS_Insights_7",
"campaignName": "prod-campaign-21145",
"campaignId": 21145,
"statusId": 3,
"statusName": "Completed",
"startDate": 1603152000,
"endDate": 1603411200,
"ioId": 5,
"ioName": "Corporate, Inc.",
"isCampaignEligible": false,
"reportCreatedOn": 1721253632,
"creativeTypeId": 11,
"ioBudgetType": 1,
"campaignTimeZoneId": 29,
"fileSizeDetails": {
"1": 1024,
"2": 1024
}
},
{
"reportId": 9,
"reportName": "530667_AQS_Insights_6",
"campaignName": "Campaign-4949",
"campaignId": 4949,
"statusId": 3,
"statusName": "Completed",
"startDate": 1603152000,
"endDate": 1603411200,
"ioId": 15,
"ioName": "Quinton for Mayor",
"isCampaignEligible": false,
"reportCreatedOn": 1720325578,
"creativeTypeId": 14,
"ioBudgetType": 1,
"campaignTimeZoneId": 29,
"fileSizeDetails": {
"1": 1024,
"2": 1024
}
}
],
"filteredRecords": 10
}
}
Get List of Campaigns Eligible for AQS Reports
GETGet a status-wise list of Campaign IDs eligible for AQS Report generation.
Response Properties
running, paused, expired array of objects | Object array of Campaign IDs mapped to each of these three Campaign statuses | |||||
object properties
| ||||||
{
"success": true,
"data": {
"running": [
{
"campaignId": 451351,
"campaignTimezoneId": 29
}
],
"paused": [
{
"campaignId": 451350,
"campaignTimezoneId": 29
}
],
"expired": [
{
"campaignId": 470839,
"campaignTimezoneId": 29
}
]
}
}
Validate AQS Report Name
GETValidate the report name for generation of AQS Reports. Checks if the name meets length requirements (3-100 characters) and ensures uniqueness within the organization.
| Query Parameters | |
|---|---|
reportName string | Name of report to validate |
Response Properties
available boolean | Indicates if the report name is available: true |
message string | Validation message |
{
"success": true,
"data": {
"available": true,
"message": "This AQS report name is valid"
}
}
{
"success": true,
"data": {
"available": false,
"message": "The name 'report_name' is already used by another report, kindly update the name"
}
}
{
"success": false,
"errorObjects": [
{
"error": "Please provide name with at least 3 characters and maximum of 100 characters"
}
]
}
Compute AQS Report Cost
POSTCompute the cost and impressions for AQS Report generation based on the campaign and date range.
| Request Schema | |
|---|---|
campaignId integer | Campaign ID |
aqsId integer | AQS Report ID (for regeneration) |
aqsName string | AQS Report name |
aqsStartDate integer | Unix epoch timestamp of start date, in seconds |
aqsEndDate integer | Unix epoch timestamp of end date, in seconds |
aqsReportTypeId integer | AQS Report Type ID |
aqsAudienceConceptGroups array of objects | Array of audience/concept group mappings |
{
"campaignId": 1,
"aqsStartDate": 1722311000,
"aqsEndDate": 1722315000,
"aqsName": "Dummy AQS Name",
"aqsReportTypeId": 1,
"aqsAudienceConceptGroups": {
"audienceId": 101,
"conceptGroupId": "202335"
}
}
{
"success": true,
"data": {
"aqsReportCreated": true,
"campaignId": 1,
"aqsStartDate": 1722311000,
"aqsEndDate": 1722315000,
"aqsChargeableImps": 1000,
"aqsChargedImps": 100,
"aqsChargeableCost": 1000,
"aqsChargedCost": 100,
"aqsName": "Dummy AQS Name",
"aqsReportTypeId": 1,
"aqsAudienceConceptGroups": {
"audienceId": 101,
"conceptGroupId": "202335"
},
"fundsAvailable": true
}
}
{
"success": true,
"data": {
"aqsReportCreated": false,
"aqsId": 1,
"aqsName": "AQS report 1",
"aqsStatusId": 1,
"aqsCreatedOn": 1722315234,
"campaignId": 1,
"ioId": 1,
"ioName": "Insertion Order Name",
"ioTypeId": 1,
"aqsReportTypeId": 1,
"aqsAudienceConceptGroups": {
"audienceId": 101,
"conceptGroupId": "202335"
}
}
}
{
"success": true,
"data": {
"aqsReportCreated": false,
"message": "AQS Insights can't be generated for this campaigns at the moment as another insight with overlapping date range is processing"
}
}
Generate AQS Report
POSTGenerate an Audience Quality Score (AQS) Report. This API calculates the cost for the impressions based on the impressions and mark up charged on the Organization and then creates the AQS Reports.
| Request Schema | |
|---|---|
campaignId integer | Campaign ID |
aqsId integer | AQS Report ID to regenerate |
aqsName string | AQS Report name |
aqsStartDate integer | Unix epoch timestamp of start date, in seconds |
aqsEndDate integer | Unix epoch timestamp of end date, in seconds |
aqsReportTypeId integer | AQS Report Type ID |
aqsAudienceConceptGroups array of objects | Array of audience/concept group mappings |
{
"campaignId": 1,
"aqsStartDate": 1722311000,
"aqsEndDate": 1722315000,
"aqsName": "Dummy AQS Name",
"aqsReportTypeId": 1,
"aqsAudienceConceptGroups": {
"audienceId": 101,
"conceptGroupId": "202335"
}
}
{
"aqsId": 1
}
{
"success": true,
"data": {
"aqsReportCreatable": true,
"aqsChargeableImps": 1,
"aqsChargedImps": 1,
"aqsChargeableCost": 1,
"aqsChargedCost": 1,
"fundsAvailable": true,
"effectiveAqsRate": 1
}
}
{
"success": true,
"data": {
"aqsReportCreated": false,
"aqsId": 1,
"aqsName": "AQS report 1",
"aqsStatusId": 1,
"aqsCreatedOn": 1722315234,
"campaignId": 1,
"ioId": 1,
"ioName": "Insertion Order Name",
"ioTypeId": 1,
"aqsReportTypeId": 1,
"aqsAudienceConceptGroups": {
"audienceId": 101,
"conceptGroupId": "202335"
}
}
}
{
"success": true,
"data": {
"aqsReportCreated": false,
"message": "AQS Insights can't be generated for this campaigns at the moment as another insight with overlapping date range is processing"
}
}
Get AQS Report Types
GETGet available AQS Report types. Returns a list of report types that can be generated. Only users from Advertiser organizations are authorized to access this API.
Response Properties
reportTypeData array of objects | Array of report type objects | |||||||||
object properties
| ||||||||||
totalRecords integer | Total number of records | |||||||||
filteredRecords integer | Number of filtered records | |||||||||
{
"success": true,
"data": {
"reportTypeData": [
{
"id": 1,
"name": "audience",
"label": "Audience",
"order": 1
},
{
"id": 2,
"name": "Campaign",
"label": "Campaign",
"order": 2
}
],
"totalRecords": 2,
"filteredRecords": 2
}
}
Download AQS Report
POSTGet a download link for an AQS Report in CSV or XLSX format. Only reports with a 'ready' status are eligible for download.
| Request Schema | |
|---|---|
fileTypeId integer | File type ID XLSX: 1 CSV: 2 |
reportId integer | AQS Report ID |
Response Properties
reportUrl string | AQS Report File URL |
{
"fileTypeId": 1,
"reportId": 50
}
{
"success": true,
"data": {
"reportUrl": "https://download.domain.com/aqs-reports/2024-12-03/50_Report.xlsx?X-Amz-Algorithm=AWS4-HMAC"
}
}
More Responses
{
"success": false,
"errorObjects": [
{
"error": "Unsupported file type provided. Please use fileType 1 for XLSX or 2 for CSV."
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "Invalid sortBy value."
}
]
}
Delete AQS Report
DELETEDelete AQS Reports that are not marked as deleted and have a 'failed' status. Requires user authorization and checks if the provided AQS IDs are valid.
| Query Parameters | |
|---|---|
reportIds string | Comma-separated AQS Report IDs |
Response Properties
success boolean | Indicates Report was successfully deleted: true |
message string | Success message |
{
"success": true,
"data": {
"message": "255944_AQS_Insights_2 deleted successfully"
}
}
Voter Level Data Reports
VLD Eligibility Requirements
VLD reports are available for Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Political | Any Campaign created under a political advertiser account is a “Political” campaign. |
| Campaign status | Running, Expired (within the past two years), Paused | |
| Campaign duration | 3 or more days | |
| Campaign creation date | September 16, 2024 or later (or earlier upon request to IQM's support team) | |
| Voter location | All US states except Oregon | Due to privacy laws in the state of Oregon, we are unable to generate the VLD Insights Report on any voters located there. Contact your account representative for more detailed information on the legality of reidentifying voters at the user level. |
| Audience type | Matched audience created from L2 IDs, Matched audience created from raw data | Your campaign must only include the audience types listed in this requirements table. For example, you cannot generate a VLD report for a campaign if it includes a Matched Audience created from L2 IDs and a Retargeted Audience consisting of your website’s past visitors. The VLD report supports audiences you create using First Name, Last Name, Address, and Phone Number. IQM anonymizes the data in the matching process, encrypts the files, and stores them behind a firewall to protect them against information leaks. |
VLD Resource Properties
Resource Properties
vldId integer | VLD ID |
vldName string | VLD name |
vldStatus integer | VLD Status Type ID |
ioId integer | Insertion Order ID |
ioName string | Insertion Order name |
ioTypeId integer | Insertion Order Budget Type ID |
isCampaignEligible boolean | Indicates that Campaign is eligible for VLD Report: true |
vldCreatedOn integer | Unix epoch timestamp of creation date, in milliseconds |
vldStartDate / startDate integer | Unix epoch timestamp of start date, in milliseconds |
vldEndDate / endDate integer | Unix epoch timestamp of end date, in milliseconds |
campaignId integer | Campaign ID |
campaignName string | Campaign name |
campaignStatus string | Campaign Status Type |
creativeTypeId integer | Creative Type ID |
campaignVldTimezoneId integer | Timezone ID |
vldReportCreatable boolean | Indicates if VLD Report can be generated for the given Campaign and date range (true) |
vldChargeableImps integer | The number of chargeable impressions for the requested VLD Report |
vldChargedImps integer | The number of impressions for which the VLD Report is already generated |
vldChargeableCost integer | Cost to generate the VLD Report |
vldChargedCost integer | Cost of VLD Report that is already generated |
fundsAvailable boolean | Indicates if sufficient funds are available in the Advertiser's account to generate the VLD Report (true) |
effectiveVldRate integer | Margin rate set by the admin and workspace for generating VLD Report |
Get List of VLD Reports
GETGet a list of VLD Reports based on search filters.
A vldId can be used in the Generate VLD Report, Download VLD Insight Report, and Delete VLD Report endpoints.
| Query Parameters | |
|---|---|
searchField string | Filter results by search field |
noOfEntries integer | Number of entries returned per page, default: 200 |
pageNo integer | Page number of retrieved data |
sortBy string | Sorts by ascending (+) or descending (-), default: -vldId |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 10,
"vldReportDataList": [
{
"vldId": 10,
"vldName": "530667_VLD_Insights_7",
"campaignName": "prod-campaign-21145",
"campaignId": 21145,
"vldStatusId": 3,
"startDate": 1603152000,
"endDate": 1603411200,
"ioId": 5,
"ioName": "Corporate, Inc.",
"isCampaignEligible": false,
"vldCreatedOn": 1721253632,
"creativeTypeId": 11,
"campaignVldTimezoneId": 29,
"ioTypeId": 1
},
{
"vldId": 9,
"vldName": "530667_VLD_Insights_6",
"campaignName": "Campaign-4949",
"campaignId": 4949,
"vldStatusId": 3,
"startDate": 1603152000,
"endDate": 1603411200,
"ioId": 15,
"ioName": "Quinton for Mayor",
"isCampaignEligible": false,
"vldCreatedOn": 1720325578,
"creativeTypeId": 14,
"campaignVldTimezoneId": 29,
"ioTypeId": 1
}
],
"filteredRecords": 10
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalRecords: number;
vldReportDataList: {
vldId: number;
vldName: string;
campaignName: string;
campaignId: number;
vldStatusId: number;
startDate: number;
endDate: number;
ioId: number;
ioName: string;
isCampaignEligible: boolean;
vldCreatedOn: number;
creativeTypeId: number;
campaignVldTimezoneId: number;
ioTypeId: number;
}[];
filteredRecords: number;
}
}
};
};
};
function getVLDReportList(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/vld-reports',
params: {
query?: {
searchField?: `string`,
pageNo?: `number`,
noOfEntries?: `number`,
sortBy?: `string`,
},
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Campaigns Eligible for VLD Reports
GETGet a list of Campaign IDs by status eligible for VLD Report generation.
Response Properties
running, paused, expired array of objects | Object array of Campaign IDs mapped to each of these three Campaign statuses | |||||
object properties
| ||||||
- JSON
- TypeScript
{
"success": true,
"data": {
"running": [
{
"campaignId": 451351,
"campaignTimezoneId": 29
}
],
"paused": [
{
"campaignId": 451350,
"campaignTimezoneId": 29
}
],
"expired": [
{
"campaignId": 470839,
"campaignTimezoneId": 29
}
]
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
running: number[];
paused: number[];
expired: number[];
}
}
};
};
};
function getStatusWiseCampaignsForVLDReports(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/vld/campaigns',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Generate VLD Report
POSTThis API calculates the cost for the impressions for the Voter Level Data Reports based on the impressions and mark up charged on the Organization and then creates the VLD Reports.
A Campaign must meet the following eligibility criteria to generate VLD Report:
- Must be political Campaign
- "running", "expired" (within last two years), "paused" status
- Must have duration of 3 or more days
- Creation date: Sept. 16, 2024 or later
- Voter location: all US states (except Oregon)
- Audience type: Matched Audience
| 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 |
vldId integer | Generate Insights Report again for VLD ID |
- 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);
}
Get Cost Assessment for VLD Report
POSTCalculates the cost for the impressions for the VLD Report based on impressions and the mark up charged on the Organization.
| Request Schema | |
|---|---|
campaignId integer | Campaign ID |
vldStartDate integer | Unix epoch timestamp of start date, in milliseconds |
vldEndDate integer | Unix epoch timestamp of end date, in milliseconds |
- JSON
- TypeScript
{
"campaignId": 1,
"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 getChargeableImpressionsDataForVLDReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/vld-reports/computation',
requestBody: {
content: {
"application/json": {
campaignId?: `number`,
vldId?: `number`,
vldStartDate?: `number`,
vldEndDate?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Download VLD Insight 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 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);
}
Delete VLD Report
DELETEDeletes VLD Reports that are not marked as deleted and have a 'failed' status, requires user authorization and checks if the provided VLD IDs are valid.
| Query Parameters | |
|---|---|
vldId integer | VLD ID |
Response Properties
success boolean | Indicates Report was succesfully deleted: true |
message string | Success message |
- JSON
- TypeScript
{
"success": true,
"data": {
"message": "255944_VLD_Insights_2 deleted successfully"
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
vldReportUrl: string;
}
}
};
};
};
function deleteFailedVLDReport(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://api.iqm.com/api/v3/ins/vld-report',
params: {
query: {
vldIds: `string`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
ScriptLift Studies Reports
SLS Eligiblity Requirements
SLS reports are available for healthcare Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Healthcare | Any Campaign created under a healthcare advertiser account is a “Healthcare” campaign. |
| Campaign status | Running, Expired (within the past two years), Paused | |
| Campaign impressions | >1 impression | |
| Campaign duration | 7 or more days | |
| Campaign start date | [Release date], 2025 or later (or earlier upon request from IQM's support team) | |
| Audience type | Matched Audience created from NPI IDs | The campaign must only include the audience type listed in this requirements table. For example, you won’t be able to generate an SLS Insights report for a campaign if it includes a matched audience created from NPI IDs and a retargeted audience consisting of your website’s past visitors. The NPI-based audience must be assigned to the campaign at the time of report creation and while report generation is in progress to remain eligible. |
SLS Resource Properties
Resource Properties
slsId integer | SLS ID |
slsName string | SLS name |
campaignIds array of integers | Campaign IDs |
slsStatusId integer | SLS Status Type ID |
startDate integer | Unix epoch timestamp of start date, in milliseconds |
endDate integer | Unix epoch timestamp of end date, in milliseconds |
ioId integer | Insertion Order ID |
ioName string | Insertion Order name |
ioTypeId integer | Insertion Order Budget Type ID |
isCampaignEligible boolean | Indicates that Campaign is eligible for SLS Report: true |
slsCreatedOn integer | Unix epoch timestamp of creation date, in milliseconds |
campaignSlsTimezoneId integer | Timezone ID |
slsChargeableImps integer | The number of chargeable impressions for the requested SLS Report |
slsChargedImps integer | The number of impressions for which the SLS Report is already generated |
slsChargeableCost integer | Cost to generate the SLS Report |
slsChargedCost integer | Cost of SLS Report that is already generated |
pdfFileSize integer | PDF file size in bytes |
excelFileSize integer | Excel file size in bytes |
slsReportTypeIds array of integers | SLS Report type IDs |
Get List of SLS Reports
GETGet a list of SLS Reports.
An slsId can be used in the Generate SLS Report, Download SLS Report, and Delete SLS Report endpoints.
| Query Parameters | |
|---|---|
searchField string | Filter results by search field |
noOfEntries integer | Number of entries returned per page, default: 200 |
pageNo integer | Page number of retrieved data |
sortBy string | Sorts by ascending (+) or descending (-), default: -slsId |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 2,
"slsReportDataList": [
{
"slsId": 10,
"slsName": "530667_SLS_Insights_7",
"campaignIds": [
21145,
21146,
21147
],
"slsStatusId": 3,
"slsStatusName": "Failed",
"startDate": 1732165200000,
"endDate": 1732424399000,
"ioId": 5,
"ioName": "Corporate, Inc.",
"isCampaignEligible": false,
"slsCreatedOn": 1721253632,
"campaignSlsTimezoneId": 29,
"ioTypeId": 1,
"pdfFileSize": 2500000,
"excelFileSize": 2500000,
"slsReportTypeIds": [
1,
2,
3
]
},
{
"slsId": 9,
"slsName": "530667_SLS_Insights_6",
"campaignId": [
4949,
5959
],
"slsStatusId": 2,
"slsStatusName": "Processing",
"startDate": 1732165200000,
"endDate": 1732424399000,
"ioId": 15,
"ioName": "Quinton for Mayor",
"isCampaignEligible": false,
"slsCreatedOn": 1720325578,
"campaignSlsTimezoneId": 29,
"ioTypeId": 1,
"slsReportTypeIds": [
1,
3
]
},
],
"filteredRecords": 2
}
}
See TypeScript Prerequisites for usage.
Generate SLS Report
POSTThis API calculates the cost for the impressions for the ScriptLift Studies Reports based on the impressions and mark up charged on the Organization and then creates the SLS Reports.
SLS reports support three report types: "Pre vs Post Analysis", "Exposed vs Underexposed Analysis", and "Competitive Analysis". Refer to our Help Center article for more details: SLS Insights Report Overview - SLS Insights Reporting Methods.
| Request Schema | |
|---|---|
ioId integer | Insertion Order ID |
campaignIds array of integers | Campaign IDs |
slsStartDate integer | Unix epoch timestamp of start date, in milliseconds |
slsEndDate integer | Unix epoch timestamp of end date, in milliseconds |
slsName string | SLS name |
slsLookbackDuration integer | SLS lookback duration |
conceptGroupId integer | Concept group ID |
reportTypes array of integers | Report type IDs 1: Pre vs Post Analysis 2: Exposed vs Underexposed Analysis 3: Competitive Analysis |
competitorConceptGroupIds array of integers | Competitor concept group IDs |
slsId integer | SLS ID to regenerate |
- JSON
- TypeScript
{
"ioId": 1234,
"campaignIds": [
1,
2,
3
],
"slsStartDate": 1722311000,
"slsEndDate": 1722315000,
"slsName": "Dummy SLS Name",
"slsLookbackDuration": 3,
"conceptGroupId": 202335,
"reportTypes": [
1,
2,
3
],
"competitorConceptGroupIds": [
800214,
800215,
800216
]
}
{
"success": true,
"data": {
"slsReportCreated": true,
"campaignIds": [
1,
2,
3
],
"slsStartDate": 1722311000,
"slsEndDate": 1722315000,
"slsChargeableImps": 1000,
"slsChargedImps": 100,
"slsChargeableCost": 1000,
"slsChargedCost": 100,
"slsName": "Dummy SLS Name",
"slsLookbackDuration": 3,
"conceptGroupId": 202335,
"reportTypes": [
1,
2,
3
],
"competitorConceptGroupIds": [
800214,
800215,
800216
],
"fundsAvailable": true
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
slsReportCreated: number;
campaignIds: number[];
slsStartDate: number;
slsEndDate: number;
slsChargeableImps: number;
slsChargedImps: number;
slsChargeableCost: number;
slsChargedCost: number;
slsName: string;
slsLookbackDuration: number;
conceptGroupId: number;
reportTypes: number[];
competitorConceptGroupIds: number[];
fundsAvailable: boolean;
}
}
};
};
}
function generateSLSReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/sls-reports',
requestBody: {
content: {
"application/json": {
ioId?: `number`,
campaignIds?: `array of numbers`,
slsId?: `number`,
slsStartDate?: `number`,
slsEndDate?: `number`,
slsName?: `string`,
slsLookbackDuration?: `number`,
conceptGroupId?: `number`,
competitorConceptGroupIds?: `array of numbers`,
reportTypes?: `array of numbers`,
endDate?: `number`,
startDate?: `number`,
id?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
SLS Reports Computation
POSTCalculates the cost for the impressions for the SLS Report based on impressions and the mark up charged on the Organization.
SLS reports support three report types: "Pre vs Post Analysis", "Exposed vs Underexposed Analysis", and "Competitive Analysis". Refer to our Help Center article for more details: SLS Insights Report Overview - SLS Insights Reporting Methods.
| Request Schema | |
|---|---|
ioId integer | Insertion Order ID |
campaignIds array of integers | Campaign IDs |
slsStartDate integer | Unix epoch timestamp of start date, in milliseconds |
slsEndDate integer | Unix epoch timestamp of end date, in milliseconds |
slsName string | SLS name |
slsLookbackDuration integer | SLS lookback duration |
conceptGroupId integer | Concept group ID |
reportTypes array of integers | Report type IDs 1: Pre vs Post Analysis 2: Exposed vs Underexposed Analysis 3: Competitive Analysis |
competitorConceptGroupIds array of integers | Competitor concept group IDs |
- JSON
- TypeScript
{
"ioId": 1234,
"campaignIds": [
1,
2,
3
],
"slsStartDate": 1722311000,
"slsEndDate": 1722315000,
"slsName": "Dummy SLS Name",
"slsLookbackDuration": 3,
"conceptGroupId": 202335,
"reportTypes": [
1,
2,
3
],
"competitorConceptGroupIds": [
800214,
800215,
800216
]
}
{
"success": true,
"data": {
"slsReportCreated": true,
"campaignIds": [
1,
2,
3
],
"slsStartDate": 1722311000,
"slsEndDate": 1722315000,
"slsChargeableImps": 1000,
"slsChargedImps": 100,
"slsChargeableCost": 1000,
"slsChargedCost": 100,
"slsName": "Dummy SLS Name",
"slsLookbackDuration": 3,
"conceptGroupId": 202335,
"reportTypes": [
1,
2,
3
],
"competitorConceptGroupIds": [
800214,
800215,
800216
],
"fundsAvailable": true
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
slsReportCreated: number;
campaignIds: number[];
slsStartDate: number;
slsEndDate: number;
slsChargeableImps: number;
slsChargedImps: number;
slsChargeableCost: number;
slsChargedCost: number;
slsName: string;
slsLookbackDuration: number;
conceptGroupId: number;
reportTypes: number[];
competitorConceptGroupIds: number[];
fundsAvailable: boolean;
}
}
};
};
}
function getChargeableImpressionsDataForSLSReports(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/sls-reports/computation',
requestBody: {
content: {
"application/json": {
ioId?: `number`,
campaignIds?: `array of numbers`,
slsId?: `number`,
slsStartDate?: `number`,
slsEndDate?: `number`,
slsName?: `string`,
slsLookbackDuration?: `number`,
conceptGroupId?: `number`,
competitorConceptGroupIds?: `array of numbers`,
reportTypes?: `array of numbers`,
endDate?: `number`,
startDate?: `number`,
id?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Validate SLS Report Name
GETValidate a name for SLS Reports.
| Query Parameters | |
|---|---|
reportName string | Report name |
Response Properties
success boolean | Indicates successful validation |
data string | Success message |
- JSON
- TypeScript
{
"success": true,
"data": "This SLS report name is valid"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string;
}
};
};
}
function validateSlsReportName(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/sls-reports/validate/name',
params: {
query: {
reportName: `string`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Campaigns Eligible for SLS Reports
GETGet a list of Campaign IDs by status eligible for VLD Report generation.
Response Properties
running, paused, expired array of objects | Object array of Campaign IDs mapped to each of these three Campaign statuses | |||||
object properties
| ||||||
- JSON
- TypeScript
{
"success": true,
"data": {
"running": [
{
"campaignId": 516038,
"campaignTimezoneId": 29
}
],
"paused": [
{
"campaignId": 523630,
"campaignTimezoneId": 29
}
],
"expired": [
{
"campaignId": 500291,
"campaignTimezoneId": 29
}
]
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
running: number[];
paused: number[];
expired: number[];
}
}
};
};
}
function getStatusWiseCampaignsForSLSReports(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/sls-reports/campaigns',
params: {
query: {
reportName: `string`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Download SLS Report
POSTGet a download link for a SLS Insight Report in CSV or XLSX format.
| Request Schema | |
|---|---|
fileType integer | File type ID XLSX: 1 CSV: 2 |
slsId integer | SLS Report ID |
Response Properties
slsReportUrl string | SLS Report File URL |
- JSON
- TypeScript
{
"fileType": 1,
"slsId": 50
}
{
"success": true,
"data": {
"slsReportUrl": "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 getSLSReportDownloadUrl(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/sls-reports/download',
requestBody: {
content: {
"application/json": {
fileTypeId?: `number`,
slsId?: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Delete SLS Report
DELETEDeletes SLS Reports that are not marked as deleted and have a 'failed' status, requires user authorization and checks if the provided SLS IDs are valid.
| Query Parameters | |
|---|---|
slsIds string | Comma separated SLS Report IDs |
Response Properties
success boolean | Indicates Report was succesfully deleted: true |
message string | Success message |
- JSON
- TypeScript
{
"success": true,
"data": {
"message": "255944_PLD_Insights_2 deleted successfully"
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
message: string;
}
}
};
};
}
function deleteFailedSLSReport(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://api.iqm.com/api/v3/ins/sls-reports',
params: {
query: {
slsIds: `string`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Report Templates
PLD Eligibility Requirements
PLD Insights reports are available for healthcare Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Healthcare | Any Campaign created under a healthcare advertiser account is a “Healthcare” campaign. |
| Campaign status | Running, Expired (within the past 90 days), Paused (within the past 90 days) | |
| Campaign duration | 7 or more days | |
| Campaign limit | Up to 50 eligible Campaigns from the same insertion order (IO) per report | |
| Audience type | Matched Audience created from NPI IDs, Matched Audience created from raw data Patient Matched Audiences are not eligible for PLD Insights reporting |
NLD Eligibility Requirements
NLD Insights reports are available for healthcare Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Healthcare | Any Campaign created under a healthcare advertiser account is a “Healthcare” campaign. |
| Campaign type | Advanced | |
| Campaign status | Running, Expired (within the past 2 years), Paused | |
| Campaign duration | At least 7 days through yesterday's date | |
| Campaign limit | Up to 50 eligible Campaigns from the same insertion order (IO) per report | |
| Audience type | Campaign must target at least one Non-NPI Nurse (Matched, Geofarmed, Contextual) Audience |
ICT Eligibility Requirements
ICT Insights reports are available for healthcare Campaigns that meet certain requirements.
Read more about these requirements in our Help Center article.
| Requirement Type | Requirement Details | Notes |
|---|---|---|
| Campaign vertical | Healthcare | Any Campaign created under a healthcare advertiser account is a “Healthcare” campaign. |
| Campaign type | Advanced | |
| Campaign status | Running, Expired (within the past 2 years), Paused | |
| Campaign duration | At least 7 days through yesterday's date | |
| Campaign limit | Up to 50 eligible Campaigns from the same insertion order (IO) per report | |
| Audience type | Campaign must target at least one Integrated Care Team (ICT) input-type (HCP, Nurse) Audience |
Get List of Templates
GETGet a list of all templates for the specified report type with optional filtering and pagination.
A templateId can be used to get Get Template Details or to update an existing template using the Update Report Template endpoint.
| Query Parameters | |
|---|---|
category string required | Insight type category: pld, ict, or nld |
searchField string | Filter templates by name |
noOfEntries integer | Number of entries per page, default: 20 |
pageNo integer | Page number for pagination, default: 1 |
frequencyIds integer | Filter by Scheduling Frequency IDs |
statusIds integer | Filter by Template Status IDs |
sortBy string | Sorts by ascending (+) or descending (-), default: -templateId |
Response Properties
templateId integer | Template ID |
name string | Template name |
frequencyId integer | Scheduling Frequency ID |
startDate integer | Unix epoch timestamp of template start date, in milliseconds |
endDate integer | Unix epoch timestamp of template end date, in milliseconds |
timezoneId integer | Timezone ID |
statusId integer | Template Status ID |
nextRunPreviewUtc integer | Unix epoch timestamp of the next scheduled run (UTC), in milliseconds |
reportIds array of integers | Associated report IDs |
campaignIds array of integers | Associated Campaign IDs |
reportStatusSummary array of objects | Summary of report counts by status ID |
statusSummary array of objects | Summary of template counts by status ID (top-level) |
filteredRecords integer | Number of records matching the applied filters |
totalRecords integer | Total number of records |
- JSON
- TypeScript
{
"success": true,
"data": {
"data": [
{
"templateId": 1,
"name": "Monthly ICT Report",
"frequencyId": 2,
"startDate": 1764843796510,
"endDate": 1764843796510,
"timezoneId": 29,
"statusId": 1,
"nextRunPreviewUtc": 1764843796510,
"reportIds": [10001, 10002, 10004],
"campaignIds": [10001, 10003],
"reportStatusSummary": [
{
"id": 1,
"count": 5
},
{
"id": 2,
"count": 2
}
]
}
],
"statusSummary": [
{
"id": 1,
"count": 5
},
{
"id": 2,
"count": 5
}
],
"filteredRecords": 1,
"totalRecords": 10
}
}
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: {
data: {
templateId: number;
name: string;
frequencyId: number;
startDate: number;
endDate: number;
timezoneId: number;
statusId: number;
nextRunPreviewUtc: number;
reportIds: number[];
campaignIds: number[];
reportStatusSummary: {
id: number;
count: number;
}[];
}[];
statusSummary: {
id: number;
count: number;
}[];
filteredRecords: number;
totalRecords: number;
}
}
}
};
}
function getAllTemplates(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/templates',
params: {
query: {
category: `string`,
searchField?: `string`,
pageNo?: `number`,
noOfEntries?: `number`,
frequencyIds?: `number`,
statusIds?: `number`,
sortBy?: `string`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Template Details
GETGet the details of a template by its template ID.
| Path Parameters | |
|---|---|
templateId integer | The ID of the template to retrieve |
Response Properties
templateId integer | Template ID |
name string | Template name |
campaignIds array of integers | Associated Campaign IDs |
frequencyId integer | Scheduling Frequency ID |
frequencyDetails object | Scheduling details based on frequency type |
startDate integer | Unix epoch timestamp of template start date, in milliseconds |
endDate integer | Unix epoch timestamp of template end date, in milliseconds |
timezoneId integer | Timezone ID |
aggregationEnabled boolean | Indicates whether report data is aggregated |
recipientEmails array of strings | Recipient email addresses |
statusId integer | Template Status ID |
nextRunPreviewUtc integer | Unix epoch timestamp of the next scheduled run (UTC), in milliseconds |
firstRunLocked boolean | Indicates whether the first run is locked |
- JSON
- TypeScript
{
"success": true,
"data": {
"templateId": 1,
"name": "Monthly PLD Report",
"campaignIds": [101, 102, 103],
"frequencyId": 2,
"frequencyDetails": {
"dayOfMonthTypeId": 2,
"dayOfMonth": 15
},
"startDate": 1704067200000,
"endDate": 1735689599000,
"timezoneId": 29,
"aggregationEnabled": true,
"recipientEmails": [
"xyz@gmail.com"
],
"statusId": 1,
"nextRunPreviewUtc": 1706745600000,
"firstRunLocked": true
}
}
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: {
templateId: number;
name: string;
campaignIds: number[];
frequencyId: number;
frequencyDetails: {
dayOfWeekId?: number;
dayOfMonthTypeId?: number;
dayOfMonth?: number;
intervalModeId?: number;
intervalValue?: number;
};
startDate: number;
endDate: number;
timezoneId: number;
aggregationEnabled: boolean;
recipientEmails: string[];
statusId: number;
nextRunPreviewUtc: number;
firstRunLocked: boolean;
}
}
}
};
}
function getTemplateById(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/templates/{templateId}',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Template Reports
GETGet the reports for a specific template with optional filtering and pagination.
| Path Parameters | |
|---|---|
templateId integer | The ID of the template for which to retrieve reports |
| Query Parameters | |
|---|---|
searchField string | Filter reports by search string |
noOfEntries integer | Number of entries per page, default: 20 |
pageNo integer | Page number for pagination, default: 1 |
sortBy string | Sorts by ascending (+) or descending (-), default: -reportId |
statusIds integer | Filter by status IDs |
frequencyIds integer | Filter by Scheduling Frequency IDs |
Response Properties
reportId integer | Report ID |
name string | Report name |
requestedStartDate integer | Unix epoch timestamp of the report's requested start date, in milliseconds |
requestedEndDate integer | Unix epoch timestamp of the report's requested end date, in milliseconds |
statusId integer | Report status ID |
frequencyId integer | Scheduling Frequency ID |
generatedAt integer | Unix epoch timestamp of when the report was generated, in milliseconds |
filePaths object | Presigned download URLs for the report files |
fileSizes object | File sizes in bytes for each format |
totalRecords integer | Total number of records |
filteredRecords integer | Number of records matching the applied filters |
statusSummary array of objects | Summary of report counts by status ID |
frequencySummary array of objects | Summary of report counts by frequency ID |
- JSON
- TypeScript
{
"success": true,
"data": {
"data": [
{
"reportId": 180,
"name": "23897_PLD_Insights_7",
"requestedEndDate": 1762885799000,
"requestedStartDate": 1762799400000,
"statusId": 3,
"frequencyId": 3,
"generatedAt": 1764671972077,
"filePaths": {
"csvUrl": "https://.../9876.csv",
"xlsxUrl": "https://.../9876.xlxs",
"pdfUrl": "https://.../9876.pdf",
"zipUrl": "https://.../9876.zip"
},
"fileSizes": {
"csvBytes": 27223,
"xlsxBytes": 98604,
"pdfBytes": 84259,
"zipBytes": 20471
}
}
],
"totalRecords": 2,
"filteredRecords": 1,
"statusSummary": [
{
"id": 3,
"count": 1
},
{
"id": 4,
"count": 1
}
],
"frequencySummary": [
{
"id": 3,
"count": 1
}
]
}
}
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: {
data: {
reportId: number;
name: string;
requestedStartDate: number;
requestedEndDate: number;
statusId: number;
frequencyId: number;
generatedAt: number;
filePaths: {
csvUrl: string;
xlsxUrl: string;
pdfUrl: string;
zipUrl: string;
};
fileSizes: {
csvBytes: number;
xlsxBytes: number;
pdfBytes: number;
zipBytes: number;
};
}[];
totalRecords: number;
filteredRecords: number;
statusSummary: {
id: number;
count: number;
}[];
frequencySummary: {
id: number;
count: number;
}[];
}
}
}
};
}
function getReportsForTemplate(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/templates/{templateId}/report',
params: {
query: {
searchField?: `string`,
pageNo?: `number`,
noOfEntries?: `number`,
sortBy?: `string`,
statusIds?: `number`,
frequencyIds?: `number`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Validate Template Name
POSTChecks if the given template name is available (not already in use) within the caller's organization.
| Request Schema | |
|---|---|
name string | Template name to validate (3–100 characters) |
category string | Insight type category: pld, ict, or nld |
Response Properties
available boolean | Indicates whether the template name is available: true or false |
- JSON
- TypeScript
{
"name": "Monthly PLD Report",
"category": "pld"
}
{
"success": true,
"data": {
"available": true
}
}
{
"success": true,
"data": {
"available": false
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
available: boolean;
}
}
};
};
}
function validateTemplateName(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/templates/validate-name',
requestBody: {
content: {
"application/json": {
name: `string`,
category: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Create Report Template
POSTCreates a report template with the given Campaigns and scheduling configuration.
The request defines a template name, associated Campaign IDs, frequency and frequency details (daily, weekly, monthly, or custom), template start/end dates, aggregation flag, recipient emails, template status, and report category.
When the template is ACTIVE, the platform will use the configured schedule to trigger periodic report generation.
| Request Schema | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string | Template name (3–100 characters) | |||||||||||
campaignIds array of integers | Campaign IDs (max 50) | |||||||||||
frequencyId integer | Scheduling Frequency ID | |||||||||||
frequencyDetails object | Scheduling details based on frequency type (see examples) | |||||||||||
| ||||||||||||
dayOfWeekId integer | Day of week (for weekly/custom-weekly) |
dayOfMonthTypeId integer | Day of month type: first day (1), specific day (2), last day (3) |
dayOfMonth integer | Specific day of month (2–28, when dayOfMonthTypeId = 2) |
intervalModeId integer | Custom interval mode: days (501), weeks (502), months (503) |
intervalValue integer | Custom interval value (e.g., every X days/weeks/months) |
startDate integer
endDate integer
aggregationEnabled boolean
recipientEmails array of strings
status string
category string
Response Properties
templateId integer | Created template ID |
nextRunDate integer | Unix epoch timestamp of the next scheduled run, in milliseconds |
- JSON
- TypeScript
{
"name": "One-Time Template",
"campaignIds": [111, 222, 333],
"frequencyId": 1,
"frequencyDetails": {},
"startDate": 1763145600000,
"endDate": 1765737600000,
"aggregationEnabled": false,
"recipientEmails": [
"a@ws.com"
],
"status": "ACTIVE",
"category": "pld"
}
{
"success": true,
"data": {
"templateId": 101,
"nextRunDate": 1764460800000
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
templateId: number;
nextRunDate: number;
}
}
};
};
}
function createTemplate(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/templates',
requestBody: {
content: {
"application/json": {
name: `string`,
campaignIds: `number[]`,
frequencyId: `number`,
frequencyDetails: {
dayOfWeekId?: `number`,
dayOfMonthTypeId?: `number`,
dayOfMonth?: `number`,
intervalModeId?: `number`,
intervalValue?: `number`,
},
startDate: `number`,
endDate?: `number`,
aggregationEnabled: `boolean`,
recipientEmails?: `string[]`,
status: `string`,
category: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Update Report Template
PATCHApply a partial update to an existing report template. Only the fields present in the request are evaluated and applied.
The platform automatically re-evaluates future executions based on the effective configuration after the update. Past executions and generated reports are never modified.
- Updates only affect future executions
- A resumed template may not necessarily produce a future run
- "One Time" templates (frequency ID 1) execute at most once
- If no future execution exists, nextRunDate will be null
| Path Parameters | |
|---|---|
templateId integer | The ID of the template to update |
Update Scenarios
| Change Made | Future Execution Impact |
|---|---|
| Metadata-only update | No impact to future executions |
| Aggregation flag toggle | Future executions are recalculated |
| End date modified | Future execution horizon is recalculated |
| Start date modified | Future execution plan is recalculated |
| Recurring → Recurring (frequency change) | Future execution pattern changes |
| Recurring → One-time | One-time execution is triggered |
| One-time → Recurring | Future recurring executions are scheduled |
| ACTIVE → INACTIVE | All future executions are stopped |
| INACTIVE → ACTIVE (recurring) | Future executions resume |
| Multiple changes in one request | Strongest applicable rule applies |
Request Schema
name string | Template name (3–100 characters) | |||||||||||
recipientEmails array of strings | Recipient email addresses | |||||||||||
status string | Template status: ACTIVE or INACTIVE | |||||||||||
frequencyId integer | Scheduling Frequency ID | |||||||||||
frequencyDetails object | Scheduling details based on frequency type | |||||||||||
| ||||||||||||
dayOfWeekId integer | Day of week (for weekly/custom-weekly) |
dayOfMonthTypeId integer | Day of month type: first day (1), specific day (2), last day (3) |
dayOfMonth integer | Specific day of month (2–28, when dayOfMonthTypeId = 2) |
intervalModeId integer | Custom interval mode: days (501), weeks (502), months (503) |
intervalValue integer | Custom interval value (e.g., every X days/weeks/months) |
startDate integer
endDate integer
aggregationEnabled boolean
Response Properties
templateId integer | Updated template ID |
nextRunDate integer | Unix epoch timestamp of the next scheduled run, in milliseconds (may be null if no future execution exists) |
- JSON
- TypeScript
{
"name": "Updated Template Name"
}
{
"success": true,
"data": {
"templateId": 101,
"nextRunDate": 1764460800000
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
templateId: number;
nextRunDate: number;
}
}
};
};
}
function updateTemplate(): Promise<Responses> {
const options = {
method: 'PATCH',
url: 'https://api.iqm.com/api/v3/ins/templates/{templateId}',
requestBody: {
content: {
"application/json": {
name?: `string`,
recipientEmails?: `string[]`,
status?: `string`,
frequencyId?: `number`,
frequencyDetails?: {
dayOfWeekId?: `number`,
dayOfMonthTypeId?: `number`,
dayOfMonth?: `number`,
intervalModeId?: `number`,
intervalValue?: `number`,
},
startDate?: `number`,
endDate?: `number`,
aggregationEnabled?: `boolean`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Report Management
Download Report
POSTDownload a PLD, NLD, or ICT Insights report. Only reports with a ready status are eligible for download. The API validates the report status, file type, and user permissions before generating a pre-signed download URL.
| Request Schema | |
|---|---|
reportId integer required | Report ID to download |
fileTypeId integer required | File type ID: 1 (XLSX), 2 (CSV), 3 (PDF), 4 (ZIP) |
Response Properties
reportUrl string | Pre-signed download URL for the report |
- JSON
- TypeScript
{
"fileTypeId": 1,
"reportId": 50
}
{
"success": true,
"data": {
"reportUrl": "https://xyz.abc.com/reports/abcd/2024-12-03/50_acbd_Report.xlsx?X-Amz-Algorithm=AWS4-HMAC"
}
}
{
"success": false,
"errorObjects": [
{
"error": "The provided ICT report ID: 50 is not in the ready state."
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
success: boolean;
data: {
reportUrl: string;
};
};
};
422: {
content: {
success: boolean;
errorObjects: Array<{ error: string }>;
};
};
};
function downloadReport(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/report/download',
data: {
fileTypeId: 1,
reportId: 50
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Delete Report
DELETEDelete PLD, NLD, or ICT reports that have a failed status. Reports that are already deleted or do not have a failed status cannot be deleted with this endpoint.
| Query Parameters | |
|---|---|
reportIds string required | Comma-separated list of Report IDs to delete |
Response Properties
message string | Success or error message |
- JSON
- TypeScript
{
"success": true,
"data": {
"message": "2 ICT insights deleted successfully"
}
}
{
"success": true,
"data": {
"message": "255944_PLD_Insights_2 deleted successfully"
}
}
{
"success": false,
"errorObjects": [
{
"error": "Some of the provided NLD ID(s) are either already deleted, do not exist, or do not have a 'failed' status."
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
success: boolean;
data: {
message: string;
};
};
};
422: {
content: {
success: boolean;
errorObjects: Array<{ error: string }>;
};
};
};
function deleteReport(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://api.iqm.com/api/v3/ins/report',
params: {
reportIds: '50,51'
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Email Report
POSTSend a PLD, NLD, or ICT Insights report as an email attachment to specified recipients. Only reports with a ready status are eligible to be emailed. Reports larger than 25 MB cannot be sent.
| Request Schema | |
|---|---|
reportId integer required | Report ID to email |
fileTypeId integer required | File type ID: 1 (XLSX), 2 (CSV), 3 (PDF), 4 (ZIP) |
emailIds array of strings required | Recipient email addresses (1–15) |
Response Properties
message string | Success or error message |
- JSON
- TypeScript
{
"fileTypeId": 1,
"emailIds": [
"user1@email.com",
"user2@email.com"
],
"reportId": 50
}
{
"success": true,
"data": {
"message": "ICT report e-mail sent successfully."
}
}
{
"success": false,
"data": {
"message": "The provided ICT ID: 50 is not in the ready state."
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
success: boolean;
data: {
message: string;
};
};
};
422: {
content: {
success: boolean;
data: {
message: string;
};
};
};
};
function emailReport(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/report/email',
data: {
fileTypeId: 1,
emailIds: ['user1@email.com'],
reportId: 50
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Regenerate Report
POSTRegenerate a PLD, NLD, or ICT Insights report that has a failed status. The report must be associated with a scheduling template. Reports that are already deleted or in a ready/processing state cannot be regenerated.
| Path Parameters | |
|---|---|
reportId integer required | Report ID to regenerate |
Response Properties
reportId integer | Report ID that was regenerated |
templateId integer | Associated Template ID |
nextRunDate integer | Unix epoch timestamp of the next scheduled run, in milliseconds |
reportName string | Name of the regenerated report |
- JSON
- TypeScript
{
"success": true,
"data": {
"reportId": 12,
"templateId": 123,
"nextRunDate": 1765774800000,
"reportName": "sample report"
}
}
{
"success": false,
"data": {
"message": "ICT Report ID : 12 is already deleted or is in READY/PROCESSING state."
}
}
{
"success": false,
"data": {
"message": "Please provide valid insights id value."
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
success: boolean;
data: {
reportId: number;
templateId: number;
nextRunDate: number;
reportName: string;
};
};
};
400: {
content: {
success: boolean;
data: {
message: string;
};
};
};
};
function regenerateReport(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://api.iqm.com/api/v3/ins/regenerate/report/{reportId}',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get More Insights Details
Get List of Insights Types
GETGet a list of Insights types by ID.
| Payment Term IDs | |
|---|---|
1 | Audience Insights |
3 | Voter Level Data |
4 | Provider Level Data |
5 | Script Lift Study |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 2,
"filteredRecords": 2,
"insightsTypeData": [
{
"id": 1,
"name": "audiences",
"label": "Audience Insights",
"order": 1
},
{
"id": 3,
"name": "voter_level_data",
"label": "Voter Level Data",
"order": 3
},
{
"id": 4,
"name": "provider_level_data",
"label": "Provider Level Data",
"order": 4
},
{
"id": 5,
"name": "script_life_study",
"label": "Script Lift Study",
"order": 5
}
]
}
}
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;
insightsTypeData: {
id: number;
name: string;
label: string;
order: number;
}[]
}
}
};
};
};
function getInsightsType(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/static/insights/type/list',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Insights Status
GETGet a list of Insights status types.
| Insights Status IDs | |
|---|---|
1 | Processing |
2 | Ready |
3 | Failed |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 3,
"filterRecords": 3,
"insightsStatusData": [
{
"id": 1,
"name": "processing",
"label": "Processing",
"order": 1
},
{
"id": 2,
"name": "ready",
"label": "Ready",
"order": 2
},
{
"id": 3,
"name": "failed",
"label": "Failed",
"order": 3
}
]
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalRecords: number;
filterRecords: number;
insightsStatusData: {
id: number;
name: string;
label: string;
order: number;
}[]
}
}
};
};
};
function getInsightsStatus(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/static/insights/status/list',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Template Statuses
GETGet all possible template statuses with their IDs, names, display names, and display orders.
| Template Status IDs | |
|---|---|
1 | Active |
2 | Inactive |
- JSON
- TypeScript
{
"success": true,
"data": [
{
"id": 1,
"name": "active",
"displayName": "Active",
"order": 1
},
{
"id": 2,
"name": "inactive",
"displayName": "Inactive",
"order": 2
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
id: number;
name: string;
displayName: string;
order: number;
}[]
}
};
};
}
function getTemplateStatuses(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/static/template-status',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get Scheduling Frequencies
GETGet static metadata for scheduling templates, including frequency types, sub-modes, and shared reference lists (day of week, day of month type).
| Frequency Type IDs | |
|---|---|
1 | One-Time |
2 | Daily |
3 | Weekly |
4 | Monthly |
5 | Custom |
- JSON
- TypeScript
{
"success": true,
"data": {
"frequencyTypes": [
{
"id": 1,
"name": "oneTime",
"displayName": "One-Time",
"order": 1,
"fields": [],
"modes": null
},
{
"id": 2,
"name": "daily",
"displayName": "Daily",
"order": 2,
"fields": [],
"modes": null
},
{
"id": 3,
"name": "weekly",
"displayName": "Weekly",
"order": 3,
"fields": [
{
"id": 301,
"name": "dayOfWeek",
"displayName": "Day of Week",
"order": 1,
"fieldType": "reference",
"min": null,
"max": null,
"allowedValuesRef": "dayOfWeek"
}
],
"modes": null
},
{
"id": 4,
"name": "monthly",
"displayName": "Monthly",
"order": 4,
"fields": [
{
"id": 401,
"name": "dayOfMonthType",
"displayName": "Day of Month Type",
"order": 1,
"fieldType": "reference",
"min": null,
"max": null,
"allowedValuesRef": "dayOfMonthType"
},
{
"id": 402,
"name": "dayOfMonth",
"displayName": "Day of Month",
"order": 2,
"fieldType": "number",
"min": 2,
"max": 28,
"allowedValuesRef": null
}
],
"modes": null
},
{
"id": 5,
"name": "custom",
"displayName": "Custom",
"order": 5,
"fields": null,
"modes": [
{
"id": 501,
"name": "days",
"displayName": "Day(s)",
"order": 1,
"fields": [
{
"id": 50101,
"name": "intervalValue",
"displayName": "Repeats In",
"order": 1,
"fieldType": "number",
"min": 1,
"max": 365,
"allowedValuesRef": null
}
]
},
{
"id": 502,
"name": "weeks",
"displayName": "Week(s)",
"order": 2,
"fields": [
{
"id": 50201,
"name": "intervalValue",
"displayName": "Repeats In",
"order": 1,
"fieldType": "number",
"min": 1,
"max": 52,
"allowedValuesRef": null
},
{
"id": 50202,
"name": "dayOfWeek",
"displayName": "Day of Week",
"order": 2,
"fieldType": "reference",
"min": null,
"max": null,
"allowedValuesRef": "dayOfWeek"
}
]
},
{
"id": 503,
"name": "months",
"displayName": "Month(s)",
"order": 3,
"fields": [
{
"id": 50301,
"name": "intervalValue",
"displayName": "Repeats In",
"order": 1,
"fieldType": "number",
"min": 1,
"max": 12,
"allowedValuesRef": null
},
{
"id": 50302,
"name": "dayOfMonthType",
"displayName": "Day of Month Type",
"order": 2,
"fieldType": "reference",
"min": null,
"max": null,
"allowedValuesRef": "dayOfMonthType"
},
{
"id": 50303,
"name": "dayOfMonth",
"displayName": "Day of Month",
"order": 3,
"fieldType": "number",
"min": 2,
"max": 28,
"allowedValuesRef": null
}
]
}
]
}
],
"references": {
"dayOfWeek": [
{
"id": 1,
"name": "monday",
"displayName": "Monday",
"order": 1
},
{
"id": 2,
"name": "tuesday",
"displayName": "Tuesday",
"order": 2
},
{
"id": 3,
"name": "wednesday",
"displayName": "Wednesday",
"order": 3
},
{
"id": 4,
"name": "thursday",
"displayName": "Thursday",
"order": 4
},
{
"id": 5,
"name": "friday",
"displayName": "Friday",
"order": 5
},
{
"id": 6,
"name": "saturday",
"displayName": "Saturday",
"order": 6
},
{
"id": 7,
"name": "sunday",
"displayName": "Sunday",
"order": 7
}
],
"dayOfMonthType": [
{
"id": 1,
"name": "firstDay",
"displayName": "First Day of Month",
"order": 1
},
{
"id": 2,
"name": "nthDay",
"displayName": "Specific Day (2-28)",
"order": 2
},
{
"id": 3,
"name": "lastDay",
"displayName": "Last Day of Month",
"order": 3
}
]
}
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface FrequencyField {
id: number;
name: string;
displayName: string;
order: number;
fieldType: string;
min: number | null;
max: number | null;
allowedValuesRef: string | null;
}
interface FrequencyMode {
id: number;
name: string;
displayName: string;
order: number;
fields: FrequencyField[];
}
interface FrequencyType {
id: number;
name: string;
displayName: string;
order: number;
fields: FrequencyField[] | null;
modes: FrequencyMode[] | null;
}
interface ReferenceItem {
id: number;
name: string;
displayName: string;
order: number;
}
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
frequencyTypes: FrequencyType[];
references: {
[key: string]: ReferenceItem[];
}
}
}
};
};
}
function getFrequencyMetadata(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://api.iqm.com/api/v3/ins/static/scheduling/frequencies',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}