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.
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 Counts
GET /api/v3/bm/campaigns/{campaignId}/dimensions/countRetrieves counts of dimensions for a specific Campaign within a given date range.
Path Parameters | |
---|---|
campaignId integer required | The Campaign ID for which the Report is being generated |
Query Parameters | |
---|---|
startDate integer | Unix epoch timestamp (in milliseconds) for Campaign start date |
endDate integer | Unix epoch timestamp (in milliseconds) for Campaign end date |
- JSON
- TypeScript
{
"success": true,
"data": {
"creative": 2,
"dealId": 0,
"openExchange": 0,
"publisherCategory": 0,
"trafficType": 2,
"deviceType": 4,
"state": 0,
"city": 0,
"zip": 0,
"exchange": 18
}
}
More Responses
{
"success": false,
"errorObjects": [
{
"error": "Missing required parameter: 'startDate'. Type: long",
"field": "startDate"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "Forbidden!"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "No campaign found with given campaign Id"
}
]
}
{
"success": false,
"errorObjects": [
{
"error": "server encountered an error !"
}
]
}
See TypeScript Prerequisites page for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
creative: number;
dealId: number;
openExchange: number;
publisherCategory: number;
trafficType: number;
deviceType: number;
state: number;
city: number;
zip: number;
exchange: number;
}
}
};
};
400: {
content: {
"application:json": {
success: boolean
errorObjects: {
error: string;
field: 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 getDimensionWiseServeCount(): Promise<Responses> {
const options = {
method: 'GET',
url: 'https://app.iqm.com/api/v3/bm/campaigns/{campaignId}/dimensions/count',
params: {
query: {
startDate: `number`,
endDate: `number`,
},
path: {
campaignId: `number`
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
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 |
- JSON
- TypeScript
{
"success": true,
"data": {
"entityWiseSpent": {
"1": 5.1,
"2": 5.76,
"3": 5.34
}
}
}
See TypeScript Prerequisites page 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 Total and Dimension Specific Count of Modeled Items for a Campaign
GET /api/v3/bm/campaigns/{campaignId}/bid-models/countGet details on total and dimension specific counts of modeled items for a specified Campaign.
Path Parameters | |
---|---|
campaignId integer required | The Campaign ID |
- JSON
- TypeScript
{
"success": true,
"data": {
"totalCount": 7,
"dimensionWiseCount": [
{
"dimensionId": 1,
"count": 5
},
{
"dimensionId": 7,
"count": 1
},
{
"dimensionId": 13,
"count": 1
}
]
}
}
See TypeScript Prerequisites page 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);
}
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 |
- JSON
- TypeScript
{
"ids": "15",
"isExcluded": 0,
"campaignId": 214269
}
{
"statusCode": 200,
"responseObject": {
"message": "The Device Types have been allowed."
}
}
See TypeScript Prerequisites page 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 See static List of Dimension IDs |
Request Schema | |
---|---|
advertiserId integer optional | Advertiser ID |
dspId integer optional | Demand Side Platform ID |
owId integer optional | Organization workspace ID |
uowId integer optional | User organization workspace ID |
campaignId integer optional | Unique ID of Campaign |
ids string optional | Creative ID |
isExcluded integer | Target entity: 0 Block entity: 1 |
- JSON
- TypeScript
{
"ids": "604675,604084",
"isExcluded": 0
}
{
"success": true,
"data": "Creatives successfully targeted for the campaign."
}
See TypeScript Prerequisites page 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.
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 [ 1 , 2 ] |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
campaignId integer | Campaign ID |
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
bidModelDataId integer | Bid Model data ID |
- 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 page 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?: [
{
campaignId?: `number`,
dimensionId?: `number`,
entityId?: `number`,
bidModelDataId?: `number`
}
]
}
]
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Update Bid Modeling Actions
PUT /api/v3/bm/campaigns/{campaignId}/bid-modelsUpdate various actions such as ADD
, UPDATE
, or DELETE
for bid modeling.
Path Parameters | |
---|---|
campaignId integer | Campaign 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 [ 1 , 2 ] |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
campaignId integer | Campaign ID |
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
bidModelDataId integer | Bid Model data 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 | Universal Organization Workspace ID |
campaignId integer | Campaign ID |
ids string | Comma separated IDs |
isExcluded boolean | |
dimensionId integer | Dimension ID |
- 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 page 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?: [
{
campaignId?: `number`,
dimensionId?: `number`,
entityId?: `number`,
bidModelDataId?: `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 [ 1 , 2 ] |
- 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 page 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 |
- JSON
- TypeScript
{
"success": true,
"data": "Bid Modelling deleted successfully!"
}
See TypeScript Prerequisites page 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 [ 1 , 2 ] |
dimensionEntityMappings
object
dimensionEntityMappings
object properties
campaignId integer | Campaign ID |
dimensionId integer | Dimension ID |
entityId integer | Entity ID |
bidModelDataId integer | Bid Model data 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 | Universal Organization Workspace ID |
campaignId integer | Campaign ID |
ids string | Comma separated IDs |
isExcluded boolean | |
dimensionId integer | Dimension ID |
- 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 page 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?: [
{
campaignId?: `number`,
dimensionId?: `number`,
entityId?: `number`,
bidModelDataId?: `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
POST /api/v3/bm/io/{ioId}/bid-modelsDELETE /api/v3/bm/io/{ioId}/bid-models
PATCH /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 |
- JSON
- TypeScript
{
"priority": 1,
"campaignIdList": [
123456,
234567,
345678,
456789
]
}
{
"success": true,
"data": "Priority Updated Successfully"
}
See TypeScript Prerequisites page 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
- 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 page 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 page 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);
}