Campaign
Pass your token to receive campaigns
Parameter |
Description |
Format |
Default value |
id |
campaign ID |
int |
- |
name |
campaign name |
string |
- |
default_path |
default path |
[]path object |
- |
rules |
rules |
[] or []rule object |
- |
traffic_source_id |
traffic source id |
int |
- |
redirect_mode |
redirect mode |
read more |
"302" |
domain |
site ID |
int |
- |
path_url |
URL path |
string |
- |
path_type |
type of used path_url |
read more |
"auto" |
cost_click |
cost click |
float |
0 |
cost_mode |
cost mode |
read more |
"cpc" |
currency |
currency |
read more |
"USD" |
beta_distribution |
beta distribution |
0 for enabled or 1 for disabled |
0 |
auto_cost |
auto cost |
0 for enabled or 1 for disabled |
0 |
same_path |
same path |
0 for enabled or 1 for disabled |
0 |
in_archive |
is it in the archive? |
0 or 1 |
- |
campaign_click_url |
full click campaign URL |
string |
- |
campaign_url |
full campaign URL |
string |
- |
Rule
Parameter |
Description |
Format |
Default value |
name |
rule name |
string |
- |
enabled |
is it in the enabled? |
0 for disabled or 1 for enabled |
0 |
conditions |
your conditions |
[string condition name]condition object |
- |
path |
your patches |
[]path object |
- |
child_rules |
nested rules |
[] or []rule object |
- |
Path
Parameter |
Description |
Format |
Default value |
name |
path name |
string |
- |
enabled |
is it in the enabled? |
0 for disabled or 1 for enabled |
0 |
weight |
weight of path |
int |
0 |
direct_linking |
direct linking checkbox |
int |
0 |
offers |
offers |
[]offer object |
- |
landers |
landers |
[]lander object |
- |
Offer
Parameter |
Description |
Format |
Default value |
use_url |
use your URL |
0 for disabled or 1 for enabled |
0 |
value |
offer ID or your URL, if use_url is enabled |
string |
- |
weight |
weight of offer |
int |
0 |
Lander
Parameter |
Description |
Format |
Default value |
enabled |
is it in the enabled? |
0 for disabled or 1 for enabled |
0 |
value |
lander ID |
int |
0 |
Condition
Parameter |
Description |
Format |
Default value |
enabled |
is it in the enabled? |
0 for disabled or 1 for enabled |
0 |
value |
condition value |
[]condition value object |
- |
verification |
verification type |
string read more |
- |
Condition name
- brand_and_model - condition name for brands and models
- browser - condition name for browser
- browser_language - condition name for browser language
- country - condition name for country
- get_param - condition name for GET parameters
- ips - condition name for IP
- os - condition name for os
- referer - condition name for referer
- uniqueness - condition name for uniqueness
- week - condition name for days of week
Condition value
The condition value takes data depending on the name of the condition
Verification types
Verification type takes data depending on the name of the condition
For condition names device_type, os, brand_and_model, ips, isp, country, browser, browser_language can take one of the string values:
For condition names user_agent,referer can take one of the string values:
- contain
- not contain
- equal
- not equal
For condition name get_param can take one of the string values:
For condition name uniqueness can take one of the string values:
For condition name week no values
Redirect mode
The parameter redirect_mode takes one string value:
- 302 - for 302 redirect
- meta_refresh - for meta refresh redirect
- double_meta_refresh - for double meta refresh redirect
Path type
The parameter path_type takes one string value:
- auto - to automatically determine the URL path
- manual - URL path is defined by the user
Cost mode
The parameter cost_code takes one string value:
Campaign list
curl -H "token: your_token" 'https://api.might.io/campaign'
After a successful execution of the request you will receive JSON object:
{
"success": true,
"data": [
{
"auto_cost": 0,
"beta_distribution": 0,
"cost_click": 1,
"cost_mode": "cpc",
"campaign_click_url": "http://yourclickurl.com",
"campaign_url": "http://yourcampaignurl.com",
"currency": "EUR",
"domain": 4,
"id": 104,
"in_archive": 0,
"name": "campaign 1",
"path_type": "auto",
"path_url": "eadca0513737236d562cb16cd32a7b61",
"redirect_mode": "302",
"traffic_source_id": 1,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[
{
"weight": 1,
"value": 10
},
],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
{
"weight": 1,
"use_url": 1,
"value": "http://yourdomain.com"
},
],
}
],
"rules": []
},
{
"auto_cost": 0,
"beta_distribution": 0,
"cost_click": 1,
"cost_mode": "cpc",
"campaign_click_url": "http://yourclickurl.com",
"campaign_url": "http://yourcampaignurl.com",
"currency": "EUR",
"domain": 4,
"id": 104,
"in_archive": 0,
"name": "campaign 2",
"path_type": "auto",
"path_url": "eadca0113737236d562cb16cd32a7b61",
"redirect_mode": "302",
"traffic_source_id": 1,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
}
]
}
],
"rules": [
{
"enabled": 1,
"name": "Rule 1",
"path":[
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 2",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 1,
"value": "http://yourdomain.com"
}
]
}
],
"conditions":{
"device_type":{
"verification": "is any of",
"values":[
"mobile"
]
},
"uniqueness":{
"verification": "is unique",
"values":[
"for campaign"
]
}
}
}
]
},
...
],
}
Object description
Get campaign by ID
curl -H "token: your_token" 'https://api.might.io/campaign/your_campaign_id'
Where:
- your_campaign_id - campaign ID
After a successful execution of the request you will receive JSON object:
{
"success": true,
"data": {
"auto_cost": 0,
"beta_distribution": 0,
"cost_click": 1,
"cost_mode": "cpc",
"campaign_click_url": "http://yourclickurl.com",
"campaign_url": "http://yourcampaignurl.com",
"currency": "EUR",
"domain": 4,
"id": 104,
"in_archive": 0,
"name": "campaign 1",
"path_type": "auto",
"path_url": "eadca0513737236d562cb16cd32a7b61",
"redirect_mode": "302",
"traffic_source_id": 1,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[
{
"weight": 1,
"value": 10
},
],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
{
"weight": 1,
"use_url": 1,
"value": "http://yourdomain.com"
},
],
}
],
"rules": []
},
}
Object description
Create campaign
Create a simple campaign that contains one offer
curl -H "token: your_token" -d 'your_request_body' -X POST 'https://api.might.io/campaign'
Where:
- your_request_body - campaign JSON object
{
"domain": 10,
"name": "simple campaign",
"traffic_source_id": 10,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
],
}
]
}
- Parameters domain, name, traffic_source_id, default_path is mandatory
After a successful execution of the request you will receive JSON object:
{
"success": true,
"data": {
"auto_cost": 0,
"beta_distribution": 0,
"cost_click": 0,
"cost_mode": "cpc",
"campaign_click_url": "http://yourclickurl.com",
"campaign_url": "http://yourcampaignurl.com",
"currency": "USD",
"domain": 10,
"id": 107,
"in_archive": 0,
"name": "simple campaign",
"path_type": "auto",
"path_url": "eadca0513737236d592cb16cd32a7b61",
"redirect_mode": "302",
"traffic_source_id": 10,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
],
}
],
},
}
Parameters domain, name, traffic_source_id, default_path is mandatory
Object description
Creating a campaign with rules, where there should be a mobile device and the first visit to the campaign
curl -H "token: your_token" -d 'your_request_body' -X POST 'https://api.might.io/campaign'
Where:
- your_request_body - campaign JSON object
{
"domain": 10,
"name": "campaign name",
"traffic_source_id": 10,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
],
}
],
"rules": [
{
"enabled": 1,
"name": "Rule 1",
"path":[
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 2",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 1,
"value": "http://yourdomain.com"
}
]
}
],
"conditions":{
"device_type":{
"verification": "is any of",
"values":[
"mobile"
]
},
"uniqueness":{
"verification": "is unique",
"values":[
"for campaign"
]
}
}
}
]
}
- Parameters domain, name, traffic_source_id, default_path is mandatory
Update campaign
curl -H "token: your_token" -d 'your_request_body' -XPUT 'https://api.might.io/campaign'
Where:
After a successful execution of the request you will receive JSON object:
{
"success": true,
"data": {
"auto_cost": 0,
"beta_distribution": 0,
"cost_click": 0,
"cost_mode": "cpc",
"campaign_click_url": "http://yourclickurl.com",
"campaign_url": "http://yourcampaignurl.com",
"currency": "USD",
"domain": 10,
"id": 107,
"in_archive": 0,
"name": "new name",
"path_type": "auto",
"path_url": "eadca0513737236d592cb16cd32a7b61",
"redirect_mode": "302",
"traffic_source_id": 10,
"default_path": [
{
"direct_linking": 0,
"enabled": 1,
"name": "Path 1",
"weight": 1,
"landers":[],
"offers":[
{
"weight": 1,
"use_url": 0,
"value": "15"
},
],
}
],
},
}
Object description
Update cost
Parameter |
Description |
Format |
Default value |
id |
campaign ID |
int |
- |
cost |
cost |
float |
- |
cost_type |
cost type |
string "all" or "click" |
- |
currency |
currency |
read more |
- |
date_from |
date of sampling start |
YYYY-MM-DD |
- |
date_to |
date of sampling end |
YYYY-MM-DD |
- |
time_from |
time of sampling start |
hh:mm:ss |
- |
time_to |
time of sampling end |
hh:mm:ss |
- |
timezone |
time zone |
read more |
- |
All parameters are required. Changes will be applied after some time.
curl -H "token: your_token" -d 'your_request_body' -XPUT 'https://api.might.io/campaign/cost'
Cost update
curl -H "token: your_token" -d '{"id": 1, "date_from": "2021-04-15", "date_to": "2021-04-15", "time_from": "00:00:00", "time_to": "23:59:59", "cost": 100.00, "cost_type": "all", "currency": "USD", "timezone": "America/Anguilla"}' -XPUT 'https://api.might.io/campaign/cost'