Bid Model API
Overview
The Bid Model API allows you to optimize advertising Campaigns for better performance. You can fine-tune metrics such as where ads appear (Include/Exclude), manage Campaign priority, and dimensions by which a Campaign is subdivided. This page covers the common endpoints and methods associated with the Bid Model API.
Bid Modeling comprises the following tools:
- Spend Ratio: determines how the Campaign budget is distributed across various dimensions, expressed as a percentage in two types
- Strict: budget is allocated up to its specified percentage as able, but will underspend if unable to meet that ratio
- Flexible: budget will reallocate if unable to fulfill its specified percentage
- Dimension Priority: dictates the sequence of bidding for specified targeting Dimensions, expressed as a range of 1-10
- Bid Modifier: adjusts the base bid of a Campaign for the specified Dimension that is modified, expressed as a multiplier in a range of 0.1-100
IQM's Bid Model currently supports applying bid modifiers to the following dimensions:
- Creative: Creative ID
- Location: State, City, Zip Code
- Inventory: Open Exchange, Publisher Category*, Deal ID**
*Spend Ratios are not supported for the Publisher Category dimension subcategory. Refer to Spend Ratio Overview Help Center article for more information.
**Bid Modifiers are not supported for the Deal ID dimension subcategory. Refer to the Bid Modifier Overview Help Center Article for more information.
Learn more about Bid Modeling with our Help Center article.
Authentication
Headers | |
---|---|
Authentication string required | Authentication bearer token See Authentication Guide |
X-IAA-OW-ID integer required | Organization Worskpace ID Header |
Bid Modeling Details
Get Campaign Dimension Statistics
GET /api/v3/bm/campaign/{campaignId}/dimensions/bid-models/countGet dimension statistics for a given Campaign ID.
Path Parameter | |
---|---|
campaignId integer | Campaign ID |
Query Parameters | |
---|---|
startDate integer | Unix epoch timestamp (in milliseconds) for the total count |
endDate integer | Unix epoch timestamp (in milliseconds) for the total count |
attributes string | List of statistics to return Supported values: totalCount, modelledCount, modelledIds |
Response Properties
data object | Name-Value pairs of dimensionId and attributes object |
totalCount integer | Total count of entities in a dimension |
modelledCount integer | Number of entities modeled in a dimension |
modelledIds object | List of modeled entity IDs |
- JSON
- TypeScript
{
"success": true,
"data": {
"1": {
"totalCount": 5,
"modelledCount": 3,
"modelledIds": [
1,
2,
3
]
},
"3": {
"totalCount": 0,
"modelledCount": 0,
"modelledIds": null
},
"4": {
"totalCount": 10,
"modelledCount": 5,
"modelledIds": [
1,
2,
3,
4,
5
]
},
"5": {
"totalCount": 0,
"modelledCount": 0,
"modelledIds": null
},
"11": {
"totalCount": 0,
"modelledCount": 0,
"modelledIds": null
},
"12": {
"totalCount": 0,
"modelledCount": 0,
"modelledIds": null
},
"13": {
"totalCount": 0,
"modelledCount": 0,
"modelledIds": null
}
}
}
See TypeScript Prerequisites for usage.
Get Dimension Specific Spending for a Campaign
GET /api/v3/bm/campaigns/{campaignId}/dimension/{dimensionId}/spentGet details on total spent by dimension for a Campaign.
Path Parameters | |
---|---|
campaignId integer required | The Campaign ID |
dimensionId integer required | Dimension ID See static List of Dimension IDs |
Response Properties
entityWiseSpent object | Name-Value pairs of dimensionId and amount spent |
- JSON
- TypeScript
{
"success": true,
"data": {
"entityWiseSpent": {
"1": 5.1,
"2": 5.76,
"3": 5.34
}
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
entityWiseSpent: {
dimensionId: number
}
}
}
}
}
};
function getDimensionWiseEntitySpentForCampaign(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/dimension/{dimensionId}/spent',
params: {
path: {
campaignId: `number`,
dimensionId: `number`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Modeled Entities for a Campaign
POST /api/v3/bm/campaigns/{campaignId}/bid-models/dimensions/{dimensionId}Get a list of modeled entities and their associated modeling data for the provided Campaign ID.
Path Parameters | |
---|---|
campaignId integer required | Campaign ID |
dimensionId integer required | Dimension ID |
Request Schema | |
---|---|
startDate integer | Unix epoch timestamp (in milliseconds) |
endDate integer | Unix epoch timestamp (in milliseconds) |
timezoneId integer | Timezone ID |
sortBy string | Sort the result set by specific field. For ascending use plus(+) sign and for descending use minus(-) sign, default: +priority |
pageNo integer | Page number for the retrieved data, default: 1 |
searchField string | Search the result by provided keyword |
noOfEntries integer | The maximum number of returned results per page, default: 10 |
skipReporting boolean | Indicates the reporting data is to be skipped, e.g. impressions and clicks will be skipped, and only Bid Modeling data will be returned |
- JSON
- TypeScript
{
"startDate": 1700758597000,
"endDate": 1708194599000,
"timezoneId": 105,
"sortBy": "+priority",
"pageNo": 1,
"searchField": "ad",
"noOfEntries": 10,
"skipReporting": false
}
{
"success": true,
"data": {
"total": {
"totalCount": 5,
"impressions": 1,
"winRate": 25,
"clicks": 0,
"eCPM": 4,
"eCPC": 0,
"dataCost": 0,
"mediaSpent": 0.004,
"CTR": 0,
"spent": 0.004,
"conversionCount": 0,
"conversionValue": 0,
"attributedClickThroughConversions": 0,
"attributedViewThroughConversions": 0,
"costPerAttributedConversions": 0,
"attributedConversionsRate": 0,
"returnOnAdSpend": 0,
"VCR": 0,
"eCPV": 0.004,
"eCPCV": 0,
"startCount": 0,
"firstCount": 0,
"midCount": 0,
"thirdCount": 0,
"completeCount": 0,
"bidImpressions": 4,
"audioVideoViewed": 0,
"prebidCost": 0
},
"data": [
{
"bidModelData": {
"id": 1,
"priority": 5,
"bidMultiplier": 1.5,
"spendRatio": 0.8,
"spendRatioTypeId": 2
},
"id": 604676,
"name": "ad-60s",
"isExcluded": 0,
"modelled": false,
"targeted": true,
"impressions": 0,
"winRate": 0,
"clicks": 0,
"eCPM": 0,
"eCPC": 0,
"dataCost": 0,
"mediaSpent": 0,
"CTR": 0,
"spent": 0,
"conversionCount": 0,
"conversionValue": 0,
"attributedClickThroughConversions": 0,
"attributedViewThroughConversions": 0,
"costPerAttributedConversions": 0,
"attributedConversionsRate": 0,
"returnOnAdSpend": 0,
"VCR": 0,
"eCPV": 0,
"eCPCV": 0,
"startCount": 0,
"firstCount": 0,
"midCount": 0,
"thirdCount": 0,
"completeCount": 0,
"bidImpressions": 0,
"audioVideoViewed": 0,
"prebidCost": 0,
"creativeStatus": "Deleted",
"creativeThumbnailSource": "https://i.gifer.com/g2vO.gif",
"creativeCardSource": "https://i.gifer.com/g2vO.gif",
"creativeType": "Video",
"spentDistribution": 0
},
{
"bidModelData": {
"id": 1,
"priority": 5,
"bidMultiplier": 1.5,
"spendRatio": 0.8,
"spendRatioTypeId": 2
},
"id": 604675,
"name": "ad-45s",
"isExcluded": 1,
"modelled": false,
"targeted": true,
"impressions": 1,
"winRate": 100,
"clicks": 0,
"eCPM": 4,
"eCPC": 0,
"dataCost": 0,
"mediaSpent": 0.004,
"CTR": 0,
"spent": 0.004,
"conversionCount": 0,
"conversionValue": 0,
"attributedClickThroughConversions": 0,
"attributedViewThroughConversions": 0,
"costPerAttributedConversions": 0,
"attributedConversionsRate": 0,
"returnOnAdSpend": 0,
"VCR": 0,
"eCPV": 0.004,
"eCPCV": 0,
"startCount": 0,
"firstCount": 0,
"midCount": 0,
"thirdCount": 0,
"completeCount": 0,
"bidImpressions": 1,
"audioVideoViewed": 0,
"prebidCost": 0,
"creativeStatus": "Running",
"creativeThumbnailSource": "https://i.gifer.com/g2vO.gif",
"creativeCardSource": "https://i.gifer.com/g2vO.gif",
"creativeType": "Video",
"spentDistribution": 0
}
],
"totalRecords": 5,
"filteredRecords": 2,
"campaignBidDetails": {
"baseBid": 20,
"maxBid": 20,
"currentPriority": 1,
"nextPerformanceCheck": 1740736800000
}
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
totalCount: number;
dimensionWiseCount: {
dimensionId: number;
count: number
}[]
}
}
}
}
};
function getModelledItemsCount(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/bid-models/count',
params: {
query: {
dimensionId: `number`
},
path: {
campaignId: `number`,
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Response Properties
bidModelData object | Object containing Bid Model Data properties | |||||||||||
|
id integer | Bid Model data ID |
priority integer | Assigned priority: [ 1 .. 10 ] |
bidMultiplier integer | Bid Multiplier [ 0.1 .. 100 ] |
spendRatio integer | Spend ratio [ 0 .. 100 ] |
spendRatioTypeId integer | Spend ratio type ID Flexible: 1 Strict: 2 |
id
integer
name
string
isExcluded
integer
modelled
boolean
targeted
boolean
totalCount
integer
impressions
integer
winRate
integer
clicks
integer
eCPM
integer
eCPC
integer
dataCost
integer
mediaSpent
integer
CTR
integer
spent
integer
conversionCount
integer
conversionValue
integer
attributedClickThroughConversion
integer
attributedViewThroughConversion
integer
costPerAttributedConversions
integer
attributedConversionsRate
integer
returnOnAdSpend
integer
VCR
integer
eCPV
integer
eCPCV
integer
startCount
integer
firstCount
integer
midCount
integer
thirdCount
integer
completeCount
integer
bidImpressions
integer
audioVideoViewed
integer
prebidCost
integer
Include/Exclude Management
Devices, Exchanges, Traffic
POST /api/v2/cmp/deviceType/includeExcludePOST /api/v2/cmp/exchange/includeExclude
POST /api/v2/cmp/trafficsource/includeExclude
The Include and Exclude options allow the you to control where ads appear.
For IDs see endpoint documentation for Device Type, Exchanges, and Traffic Source in the Master API.
Request Schema | |
---|---|
ids string | ID of entity |
isExcluded integer | Allow targeted entity: 0 Block targeted entity: 1 |
campaignId integer | Campaign ID |
Response Properties
message string | Success message |
- JSON
- TypeScript
{
"ids": "15",
"isExcluded": 0,
"campaignId": 214269
}
{
"statusCode": 200,
"responseObject": {
"message": "The Device Types have been allowed."
}
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json;charset=UTF-8": {
statusCode: number;
responseObject: {
message: string;
};
};
};
};
};
function DeviceType-includeExclude(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v2/cmp/deviceType/includeExclude',
params: {
header: {
"X-IAA-HOST": `string`
}
},
requestBody: {
content: {
"application/json": {
ids: `string`,
isExcluded: `number`,
campaignId: `number`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Include/Exclude Entities From a Campaign
POST /api/v3/bm/campaigns/{campaignId}/include-Exclude/dimensions/{dimensionId}Optimize a Campaign by updating the status of specified entities to be either included or excluded with path parameters campaignId and dimensionId.
Path | |
---|---|
campaignId integer | Campaign ID |
dimensionId integer | Dimension ID |
Request Schema | |
---|---|
ids string optional | Creative ID |
isExcluded integer | Target entity: 0 Block entity: 1 |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"ids": "604675,604084",
"isExcluded": 0
}
{
"success": true,
"data": "Creatives successfully targeted for the campaign."
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function toggleCampaignDimensionStatus(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/include-exclude/dimensions/{dimensionId}',
params: {
path: {
campaignId: `number`,
dimensionId: `number`
}
},
requestBody: {
content: {
"application/json": {
advertiserId: `number`,
dspId: `number`,
owId: `number`,
uowId: `number`,
campaignId: `number`,
ids: `string`,
isExcluded: `number`
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Bid Modeling Management
Add Bid Modeling
POST /api/v3/bm/campaigns/{campaignId}/bid-modelsAdd Bid Modeling for different dimensions. Validates and calculates others as Bid Modeling as well.
Bid Modeling criteria:
- Bid Multiplier & Dimension Priority
- Campaign must be at least 3 days long
- Campaign's daily budget must be at least $100
- Base bid and max bid price must be defined for the Campaign
- Spend Ratio
- Strict spend ratios must equal 100% across all allocated dimensions
- Flexible spend ratios require a dimension priority
IQM's Bid Model currently supports applying bid modifiers to the following dimensions:
- Creative: Creative ID
- Location: State, City, Zip Code
- Inventory: Open Exchange, Publisher Category*, Deal ID**
*Note that Spend Ratios are not supported for the Publisher Category dimension subcategory. Refer to Spend Ratio Overview Help Center article for more information.
**Not that Bid Modifiers are not supported for the Deal ID dimension subcategory. Refer to the Bid Modifier Overview Help Center Article for more information.
Path Parameters | |
---|---|
campaignId integer | Campaign ID |
Request Schema | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bidModelling object | Object containing Bid Modeling properties | |||||||||||||||||||||||||
|
bidModelData object | Object containing Bid Model Data properties | |||||||||||
|
id integer | Bid Model data ID |
priority integer | Assigned priority: [ 1 .. 10 ] |
bidMultiplier integer | Bid Multiplier [ 0.1 .. 100 ] |
spendRatio integer | Spend ratio [ 0 .. 100 ] |
spendRatioTypeId integer | Spend ratio type ID Flexible: 1 Strict: 2 |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"bidModelling": [
{
"bidModelData": {
"id": 1,
"priority": 1,
"spendRatio": 100,
"spendRatioTypeId": 1,
"bidMultiplier": 1
},
"dimensionEntityMappings": [
{
"dimensionId": 1,
"entityId": 583002
}
]
}
]
}
{
"success": true,
"data": "Priority Updated Successfully"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function addBidModellingOfDimensionForCampaign(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/bid-models',
params: {
path: {
campaignId: `number`
}
},
requestBody: {
content: {
"application/json": {
bidModelling: [
{
bidModelData?: {
id?: `number`,
priority?: `number`,
bidMultiplier?: `number`,
spendRatio?: `number`,
spendRatioTypeId?: `number`
},
dimensionEntityMappings?: [
{
dimensionId?: `number`,
entityId?: `number`,
}
]
}
]
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Update Bid Modeling Actions
PUT /api/v3/bm/campaigns/{campaignId}/bid-models/{dimensionId}Update various actions such as ADD
, UPDATE
, or DELETE
for Bid Modeling.
Path Parameters | |
---|---|
campaignId integer | Campaign ID |
dimensionId integer | Dimension ID |
Request Schema | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bidModelRequests array of objects | Objects containing Bid Model actions | |||||||||||||||||||||||||||||
|
action string | Supported values specifying Bid Model action: ADD , UPDATE , DELETE | |||||||||||
bidModelData object | Object containing Bid Model data | |||||||||||
|
id integer | Bid Model data ID |
priority integer | Assigned priority: [ 1 .. 10 ] |
bidMultiplier integer | Bid Multiplier [ 0.1 .. 100 ] |
spendRatio integer | Spend ratio [ 0 .. 100 ] |
spendRatioTypeId integer | Spend ratio type ID Flexible: 1 Strict: 2 |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
bidModelDataIds
array of integers
baseBid
integer
excludeDimensionEntityMappings
object
excludeDimensionEntityMappings
object properties
advertiserId integer | Advertiser ID |
dspId integer | DSP ID |
owId integer | Organization Workspace ID |
uowId integer | User Organization Workspace ID |
campaignId integer | Campaign ID |
ids string | Comma separated IDs |
isExcluded boolean | Indicates the entity is excluded from the Bid Model: true |
dimensionId integer | Dimension ID |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"bidModelRequests": [
{
"action": "ADD",
"bidModelData": {
"priority": 1,
"bidMultiplier": 1,
"spendRatio": 1,
"spendRatioTypeId": 1
},
"dimensionEntityMappings": [
{
"dimensionId": 1,
"entityId": 640245
}
]
},
{
"action": "ADD",
"bidModelData": {
"priority": 1,
"bidMultiplier": 1,
"spendRatio": 1,
"spendRatioTypeId": 1
},
"dimensionEntityMappings": [
{
"dimensionId": 1,
"entityId": -1
}
]
},
{
"action": "UPDATE",
"bidModelData": {
"id": 883,
"priority": 1,
"bidMultiplier": 1,
"spendRatio": 1,
"spendRatioTypeId": 1
}
},
{
"action": "UPDATE",
"bidModelData": {
"id": 894,
"priority": 1,
"bidMultiplier": 1,
"spendRatio": 1,
"spendRatioTypeId": 1
}
},
{
"action": "DELETE",
"bidModelDataIds": [
893
]
}
],
"baseBid": 3.1,
"excludeDimensionEntityMappings": [
{
"dimensionId": 1,
"ids": "1,2,3",
"isExcluded": 0
},
{
"dimensionId": 2,
"ids": "1,2,3",
"isExcluded": 1
}
]
}
{
"success": true,
"data": "Bid Modelling updated successfully!"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function manageBidModelling(): Promise<Responses> {
const options = {
method: 'PUT',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/bid-models',
params: {
path: {
campaignId: `number`
}
},
requestBody: {
content: {
"application/json": {
bidModelRequests?: [
{
bidModelData?: {
id?: `number`,
priority?: `number`,
bidMultiplier?: `number`,
spendRatio?: `number`,
spendRatioTypeId?: `number`,
},
dimensionEntityMappings?: [
{
dimensionId?: `number`,
entityId?: `number`,
}
],
action: [ "ADD" | "UPDATE" | "DELETE" ],
bidModelDataIds?: `array of numbers`,
}
],
baseBid?: `number`,
excludeDimensionEntityMappings?: [
{
advertiserId?: `number`,
dspId?: `number`,
owId?: `number`,
uowId?: `number`,
campaignId?: `number`,
ids?: `string`,
isExcluded?: `number`,
dimensionId?: `number`,
}
]
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Update Bid Modeling Dimensions
PATCH /api/v3/bm/campaigns/{campaignId}/bid-modelsUpdate Bid Modeling for different dimensions.
Path Parameters | |
---|---|
campaignId integer | Campaign ID |
Request Schema | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
bidModelData object | Object containing Bid Model Data properties | |||||||||||
|
id integer | Bid Model data ID |
priority integer | Assigned priority: [ 1 .. 10 ] |
bidMultiplier integer | Bid Multiplier [ 0.1 .. 100 ] |
spendRatio integer | Spend ratio [ 0 .. 100 ] |
spendRatioTypeId integer | Spend ratio type ID Flexible: 1 Strict: 2 |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"bidModelData": [
{
"id": 1,
"priority": 1,
"spendRatio": 50,
"spendRatioTypeId": 1,
"bidMultiplier": 1
},
{
"id": 1,
"priority": 10,
"spendRatio": 50,
"spendRatioTypeId": 1,
"bidMultiplier": 1
}
]
}
{
"success": true,
"data": "Bid Modelling updated successfully!"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function updateBidModellingForCampaign(): Promise<Responses> {
const options = {
method: 'PATCH',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/bid-models',
params: {
path: {
campaignId: `number`
}
},
requestBody: {
content: {
"application/json": {
bidModelData?: [
{
id?: `number`,
priority?: `number`,
bidMultiplier?: `number`,
spendRatio?: `number`,
spendRatioTypeId?: `number`
}
]
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Delete Bid Modeling Data
DELETE /api/v3/bm/campaigns/{campaignId}/bid-modelsDelete all Bid Modeling for a Campaign or dimension, or based on Bid Modeling data IDs.
Path Parameters | |
---|---|
campaignId integer | Campaign ID |
Query Parameters | |
---|---|
dimensionIds string | Comma separated dimension IDs to delete Bid Modeling data for |
bidModelDataIds string | Comma separated Bid Model data IDs to delete |
campaignId string | Campaign ID to delete Bid Modeling data for |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"success": true,
"data": "Bid Modelling deleted successfully!"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function deleteBidModelling(): Promise<Responses> {
const options = {
method: 'DELETE',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/bid-models',
params: {
query?: {
dimensionIds?: `string`,
bidModelDataIds?: `string`,
campaignId?: `number`,
},
path: {
campaignId: `number`
}
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Manage Insertion Order Bid Modeling
PUT /api/v3/bm/io/{ioId}/bid-modelsAdd, update, or remove Bid Modeling at the Insertion Order level. Changes will be applied to all Campaigns associated with specified Insertion Order.
Path | |
---|---|
ioId integer | Insertion Order ID |
Request Schema | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bidModelRequests array of objects | Objects containing Bid Model actions | |||||||||||||||||||||||||||||
|
action string | Supported values specifying Bid Model action: ADD , UPDATE , DELETE | |||||||||||
bidModelData object | Object containing Bid Model data | |||||||||||
|
id integer | Bid Model data ID |
priority integer | Assigned priority: [ 1 .. 10 ] |
bidMultiplier integer | Bid Multiplier [ 0.1 .. 100 ] |
spendRatio integer | Spend ratio [ 0 .. 100 ] |
spendRatioTypeId integer | Spend ratio type ID Flexible: 1 Strict: 2 |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
bidModelDataIds
array of integers
baseBid
integer
excludeDimensionEntityMappings
object
excludeDimensionEntityMappings
object properties
advertiserId integer | Advertiser ID |
dspId integer | DSP ID |
owId integer | Organization Workspace ID |
uowId integer | User Organization Workspace ID |
campaignId integer | Campaign ID |
ids string | Comma separated IDs |
isExcluded boolean | Indicates the entity is excluded from the Bid Model: true |
dimensionId integer | Dimension ID |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"bidModelRequests": [
{
"action": "ADD",
"bidModelData": {
"priority": 1
},
"dimensionEntityMappings": [
{
"campaignId": 1
}
]
},
{
"action": "UPDATE",
"bidModelData": {
"id": 3677,
"priority": 2
}
},
{
"action": "DELETE",
"bidModelDataIds": [
893
]
}
]
}
{
"success": true,
"data": "Priority Updated Successfully"
}
More Responses
{
"success": false,
"errorObjects": [
{
"error": "Forbidden!"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "Cannot assign priority as campaign is in invalid status"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "server encountered an error !"
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
403: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
};
};
422: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
};
};
500: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
};
};
};
function managePriorityToCampaign(): Promise<Responses> {
const options = {
method: 'PUT',
url: 'https://app.iqm.com/api/v3/bm/io/{ioId}/bid-models',
params: {
path: {
ioId: `number`
}
},
requestBody: {
content: {
"application/json": {
bidModelRequests?: [
{
bidModelData?: {
id?: `number`,
priority?: `number`,
bidMultiplier?: `number`,
spendRatio?: `number`,
spendRatioTypeId?: `number`,
},
dimensionEntityMappings?: [
{
dimensionId?: `number`,
entityId?: `number`,
}
],
action: [ "ADD" | "UPDATE" | "DELETE" ],
bidModelDataIds?: `[number]`,
}
],
baseBid?: `number`,
excludeDimensionEntityMappings?: [
{
advertiserId?: `number`,
dspId?: `number`,
owId?: `number`,
uowId?: `number`,
campaignId?: `number`,
ids?: `string`,
isExcluded?: `number`,
dimensionId?: `number`,
}
]
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Manage Insertion Order Priority
/api/v3/bm/io/{ioId}/bid-models/api/v3/bm/io/{ioId}/bid-models
/api/v3/bm/io/{ioId}/bid-models
Add, update, or delete priorities at the Insertion Order level. Changes will be applied to all Campaigns associated with the Insertion Order.
Assigning priority to Campaigns allows the you to establish a sequential order of bidding to fine-tune their targeting strategy. Priority may be assigned (ranging 1 to 10) to multiple campaignIds.
Query Parameters | DELETE only |
---|---|
campaignIds string | Comma separated Campaign IDs |
Path Parameters | |
---|---|
ioId integer | Insertion Order ID |
Properties | |
---|---|
priority integer required | Assigned priority: [ 1 .. 10 ] |
campaignIdList array of integers required | Campaign IDs |
Response Properties
data string | Success message |
- JSON
- TypeScript
{
"priority": 1,
"campaignIdList": [
123456,
234567,
345678,
456789
]
}
{
"success": true,
"data": "Priority Updated Successfully"
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: string
}
};
};
};
function addPriorityToCampaign(): Promise<Responses> {
const options = {
method: 'POST'
url: 'https://app.iqm.com/api/v3/bm/io/{ioId}/bid-models',
params: {
path: {
ioId: `number`
}
},
requestBody: {
content: {
"application/json": {
priority: `number`,
campaignIds: `array of numbers`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
function deletePriorityToCampaign(): Promise<Responses> {
const options = {
method: 'DELETE'
url: 'https://app.iqm.com/api/v3/bm/io/{ioId}/bid-models',
params: {
path: {
ioId: `number`
}
},
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
function updatePriorityToCampaign(): Promise<Responses> {
const options = {
method: 'PATCH'
url: 'https://app.iqm.com/api/v3/bm/io/{ioId}/bid-models',
params: {
path: {
ioId: `number`
}
},
requestBody: {
content: {
"application/json": {
priority: `number`,
campaignIds: `array of numbers`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Bid Model Metrics and Dimensions
Get Metrics Report For a Given Campaign and Dimension
POST /api/v3/bm/campaigns/{campaignId}/reports/{dimensionId}Generate a detailed metrics Report for a specific Campaign, segmented by dimension.
Path Parameters | |
---|---|
campaignId integer required | Campaign ID |
dimensionId integer required | Dimension ID |
Query Parameters
searchField string | Search results by keyword |
sortBy string | Sorts by ascending (+) or descending (-) Default: -impressions |
pageNo integer | Page number for the data Default: 1 |
pageSize integer | Maximum number of results returned Default: 50 |
timeZoneId integer | Timezone ID |
startDate integer | Unix epoch timestamp of Campaign start date, in milliseconds |
endDate integer | Unix epoch timestamp of Campaign end date, in milliseconds |
Request Schema
fileName string | File name | |||||
columns object | Object containing label and value | |||||
|
label string | Serves as the header row in the downloaded CSV/XLSX file, each label corresponds to a data field, displayed as the column header in the file |
value string | Represents the data key used to retrieve values from the result map sourced from the database, ensures each column in the CSV/XLSX file accurately reflects the relevant data, with applied formatting and timezone adjustments as needed |
fileType
string
token
string
download
boolean
Response Properties
url string | Download URL |
- JSON
- TypeScript
{
"fileName": "Stage Shared Advertiser_deal_id_1708536470049",
"columns": [
{
"label": "Deal ID",
"value": "name"
},
{
"label": "eCPM($)",
"value": "eCPM"
}
],
"fileType": "csv",
"token": "fd5b502b-3c49-4703-83d9-df1b397011a2",
"download": true
}
{
"success": true,
"data": {
"url": "DownloadURL"
}
}
More Responses
{
"success": false,
"errorObjects": [
{
"error": "Forbidden!"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "The campaign ID is missing or invalid. Please provide a valid campaign ID."
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "server encountered an error !"
}
]
}
See TypeScript Prerequisites for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success?: boolean;
data?: {
url: string
}
};
};
};
401: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
}
};
422: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
}
};
500: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string
}[]
}
}
};
}
function fetchCampaignMetricsByDimension(): Promise<Responses> {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/reports/{dimensionId}',
params: {
query?: {
searchField?: `string`,
sortBy?: `string`,
pageNo?: `number`,
pageSize?: `number`,
timeZoneId?: `number`,
startDate?: `number`,
endDate?: `number`,
},
path: {
campaignId: `number`,
dimensionId: `number`
}
},
requestBody: {
content: {
"application/json": {
fileName: `string`,
columns: [
{
label: `string`,
value: `string`
}
],
fileType: `string`,
token: `string`,
download: `boolean`
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Get List of Bid Model Dimensions
GET /api/v3/bm/static/dimensionsThis API will provide values of Bid Model dimensions and sub-dimensions.
Dimensions | |
---|---|
1 | Creative |
2 | Inventory |
3 | Deal ID |
4 | Open Exchange |
5 | Publisher Category |
6 | Device |
7 | Traffic Type |
8 | Device Type |
9 | Location |
10 | State |
11 | City |
12 | Zip |
13 | Exchange |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalRecords": 5,
"filteredRecords": 5,
"dimensions": [
{
"name": "creative",
"id": 1,
"label": "Creative",
"order": 1,
"modellingEnabled": true
},
{
"name": "inventory",
"id": 2,
"label": "Inventory",
"order": 2,
"modellingEnabled": false,
"subdimensions": [
{
"name": "deal_id",
"id": 3,
"label": "Deal ID",
"order": 1,
"modellingEnabled": false
},
{
"name": "open_exchange",
"id": 4,
"label": "Open Exchange",
"order": 2,
"modellingEnabled": false
},
{
"name": "publisher_category",
"id": 5,
"label": "Publisher Category",
"order": 3,
"modellingEnabled": false
}
]
},
{
"name": "device",
"id": 6,
"label": "Device",
"order": 3,
"modellingEnabled": false,
"subdimensions": [
{
"name": "traffic_type",
"id": 7,
"label": "Traffic Type",
"order": 1,
"modellingEnabled": false
},
{
"name": "device_type",
"id": 8,
"label": "Device Type",
"order": 2,
"modellingEnabled": false
}
]
},
{
"name": "location",
"id": 9,
"label": "Location",
"order": 4,
"modellingEnabled": false,
"subdimensions": [
{
"name": "state",
"id": 10,
"label": "State",
"order": 1,
"modellingEnabled": false
},
{
"name": "city",
"id": 11,
"label": "City",
"order": 2,
"modellingEnabled": false
},
{
"name": "zip",
"id": 12,
"label": "Zip",
"order": 3,
"modellingEnabled": false
}
]
},
{
"name": "exchange",
"id": 13,
"label": "Exchange",
"order": 5,
"modellingEnabled": false
}
]
}
}
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;
dimensions: {
name: string;
id: number;
label: string;
order: number;
modellingEnabled: boolean
subdimensions?: {
name: string;
id: number;
label: string;
order: number;
modellingEnabled: boolean
}[]
}[]
}
}
};
};
}
function getDimensions(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://app.iqm.com/api/v3/bm/static/dimensions',
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}