You can create and manage API Keys via https://dashboard.mybid.io/key-gateways
Each request returns a response in the format:
{
"code": int,
"message": text,
"data": json
}
code - Status code of the responsemessage - Error messagedata - Data returned in response to the request200 - Request completed successfully400 - Validation error401 - Authorization issues500 - Internal errorGET /gateway/v1/api/current-balanceOnly the API key needs to be passed in the request.
{
"code": int,
"message": text,
"data": {
"current_balance": float
}
}
current_balance - current balance
curl --location 'http://api.mybid.io/gateway/v1/api/current-balance' \
--header 'X-Auth-Token: {{api_key}}'
{
"code": 401,
"message": "api key is not valid",
"data": null
}
curl --location 'http://api.mybid.io/gateway/v1/api/current-balance' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 200,
"message": "",
"data": {
"current_balance": 6849.651174751568
}
}
GET /gateway/v1/api/campaignsOnly the API key needs to be passed in the request.
{
"code": int,
"message": text,
"data": [{
"id": int,
"name": text,
"adtype":text,
"budget": float,
"status": text,
"tracking_url":text,
"daily_budget": float,
"Total_spend": float,
"daily_spend": float,
"bid": float
}]
}
id - campaign IDname - campaign nameadtype - campaign typebudget - campaign budgetstatus - campaign statustracking_url - URL to which users are redirecteddaily_budget - campaign daily budgetTotal_spend - campaign total spenddaily_spend - campaign daily spendbid - campaign bidcurl --location 'http://api.mybid.io/gateway/v1/api/campaigns' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 200,
"message": "",
"data": [{
"id": 502,
"name": "test_inpage_adv_direct",
"adtype": "inpage",
"budget": 0,
"status": "active",
"tracking_url": "https://mybid.io/campaigns/new",
"daily_budget": 0,
"total_spend": 86.03763403306333,
"daily_spend": 0,
"bid": 0.00015
},
{
"id": 509,
"name": "test_c_mng_dir",
"adtype":"push",
"budget": 0,
"status": "paused",
"tracking_url": "https://mybid.io/campaigns/new",
"daily_budget": 0,
"total_spend": 111.12182032043002,
"daily_spend": 0,
"bid": 0.001
},
{
"id": 510,
"name": "test_inpage_adv_direct1",
"adtype": "inpage",
"budget": 0,
"status": "paused",
"tracking_url": "https://mybid.io/campaigns/new",
"daily_budget": 0,
"total_spend": 185.07603906435966,
"daily_spend": 0,
"bid": 0.001
}]
}
GET /gateway/v1/api/campaign/status/:idYou need to pass the API key and specify the campaign ID in the request parameters to get the campaign status.
{
"code": int,
"message": text,
"data": {
"id": int,
"status": text
}
}
id - campaign IDstatus - campaign statuscurl --location 'http://api.mybid.io/gateway/v1/api/campaign/status/382' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 200,
"message": "",
"data": {
"id": 382,
"status": "active"
}
}
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/status/3820000' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 204,
"message": "content not found",
"data": null
}
GET /gateway/v1/api/campaign/:idYou need to pass the API key and specify the campaign ID in the request parameters to get the campaign data.
{
"code": int,
"message": text,
"data": {
"id": int,
"name": text,
"adtype" : text,
"budget": float,
"status": text,
"tracking_url": text,
"os_type_familie_version_whitelist": {"os_type": {"family": [1,2,3 ("version")]}},
"os_type_familie_version_blacklist": {"os_type": {"family": [1,2,3 ("version")]}},
"capping_settings": [text],
"capping_unique_settings": string,
"daily_budget": float,
"bid": float,
"bid_by_source": {text: float, text: float}
"black_list": [text],
"white_list":[text],
"smart_purchase": boolean
}
}
id - campaign IDname - campaign nameadtype - campaign ad formatbudget - campaign budgetstatus - campaign statustracking_url - tracking URLos_type_familie_version_whitelist - whitelist for OS type, family, and version filteringos_type_familie_version_blacklist - blacklist for OS type, family, and version filteringcapping_settings - capping settingscapping_unique_settings - type of user uniqueness determination (“ip“ or “ip+ua“)daily_budget - daily campaign budgetbid - campaign bidbid_by_source - campaign bid by source listblack_list - blacklist sourcewhite_list - whitelist sourcesmart_purchase - SmartCPC traffic purchase. Use only for adtype: popunder, inpagecurl --location 'http://api.mybid.io/gateway/v1/api/campaign/15964' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 200,
"message": "",
"data": {
"id": 15964,
"name": "test_push",
"adtype":"push",
"budget": 0,
"status": "paused",
"tracking_url": "https://mybid.io/campaigns",
"os_type_familie_version_whitelist": {
"mobile": {
"android": [
3,
5,
7
]
}
},
"os_type_familie_version_blacklist": {
},
"capping_settings": [
{
"type": "impression",
"limit": 1,
"duration": 2
},
{
"type": "click",
"limit": 1,
"duration": 2
}
],
"capping_unique_settings": "ip+ua",
"daily_budget": 95.07,
"bid": 0.4,
"bid_by_source": {
"123": 0.1,
"124": 0.1
},
"black_list": [ "11", "12", "14", "15”, "16"],
"white_list": [“1”, “2”]
"smart_purchase": false
}
}
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/15964000' \ --header 'X-Auth-Token: *****MRCP'
{
"code": 204,
"message": "content not found",
"data": null
}
POST /gateway/v1/api/statisticPass the required fields in the request body:
{
"campaigns": [int],
"ad_types": [text],
"countries": [text],
"os_types": [text],
"os_families": [text],
"date_from": "YYYY-MM-DD",
"date_to": "YYYY-MM-DD",
"group_by": text
}
campaigns - list of campaign IDsad_types - list of ad types ("push", "native", "popunder", "inpage", "banner", "video")countries - list of countries (ISO 3166-1 alpha-2)os_types - list of operating system types ("computer", "tablet", "mobile", "console", "wearable", "smarttv") limitation with group_by (see the last point)os_families - list of operating system families ("windowsphone", "windows", "macosx", "ios", "android", "blackberry", "chromeos", "kindle", "webos", "playstation", "xbox", "nintendo", "linux") limitation with group_by (see the last point) date_from - start date of the statistic (format: YYYY-MM-DD)date_to - end date of the statistic (format: YYYY-MM-DD)group_by - how the data should be grouped (options: "campaign", "os", "country", "day", "source", "spot", "creative")group_by with os_types or os_families filter - how the data should be grouped (options: "os", "spot", "creative"){
"code": 200,
"message": "ok",
"data": {
"goals": [],
"stats": [
{
"campaign_id": int,
"clicks": int,
"conversions": int,
"cr": float,
"ctr": float,
"cpl": float,// deprecated
"impressions": int,
"platform": text,
"revenue": float,
"spent": float,
"cv": float,
"roi": float,
"ecpa": float
"goals": [
{
"id": int,
"conversions": float,
"ecpa": float,
"cr": float,
"cv": float,
"revenue": float,
"roi": float
}
]
}
],
"summary": {
"clicks": int,
"conversions": int,
"cr": float,
"ctr": float,
"cpl": float,// deprecated
"impressions": int,
"revenue": float,
"spent": float,
"cv": float,
"roi": float,
"ecpa": float
}
}
}
stats - List of statistics based on the group_by parametersummary - Summary statistics of the entire responsecurl --location --request POST 'http://api.mybid.io/gateway/v1/api/statistic' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"campaigns": [480],
"ad_types": ["push", "inpage"],
"countries": ["LK", "US"],
"os_types": ["mobile", "computer"],
"os_families": ["android", "ios"],
"date_from": "2024-09-01",
"date_to": "2024-09-20",
"group_by": "country"
}'
{
"code": 200,
"message": "ok",
"data": {
"goals": [],
"stats": [
{
"campaign_id": 480,
"clicks": 1508488,
"conversions": 2494,
"cr": 0.165,
"ctr": 4.42,
"cpl": 0.028,
"impressions": 34125286,
"platform": "ios",
"revenue": 0,
"spent": 3207.648458369033,
"cv": 0,
"roi": -100,
"goals": [
{
"id": 1,
"conversions": 0.02,
"ecpa": 0.3,
"cr": 0.001,
"cv": 0.01,
"revenue": 0.001,
"roi": 0.5
}
]
}
],
"summary": {
"clicks": 1508488,
"conversions": 2494,
"cr": 0.165,
"ctr": 4.42,
"cpl": 0.028,
"impressions": 34125286,
"revenue": 0,
"spent": 3207.648458369033,
"cv": 1,
"roi": -99
}
}
}
curl --location --request POST 'http://api.mybid.io/gateway/v1/api/statistic' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"campaigns": [480, 490],
"ad_types": ["push", "inpage"],
"countries": ["LK", "US"],
"os_types": ["mobile" , "computer"],
"os_families": ["android", "ios"],
"date_from": "2024-09-01",
"date_to": "2024-09-20",
"output_format": "csv",
"group_by": "country"
}'
{
"code": 200,
"message": "ok",
"data": {
"filename": "assets/uploads/by_country_from_2024-09-01_to_2024-09-19_report_time_2024-09-23T07:37:38Z.csv"
}
}
PUT /gateway/v1/api/campaign/statusYou need to pass the API key and:
{
"id": int,
"status": text
}
id - campaign ID for which you need to change the statusstatus - campaign status to set (only 'active' and 'paused' statuses can be set){
"code": int,
"message": text,
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"id": 382,
"status": "active"
}'
{
"code": 200,
"message": "Ok",
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"id": 382,
"status": "blabla"
}'
{
"code": 400,
"message": "status is not valid",
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"id": 382,
"status": "blabla"
}'
{
"code": 500,
"message": "try again later",
"data": null
}
PUT /gateway/v1/api/campaign/:idYou need to pass the API key, specify the campaign ID in the request parameters, and pass in the Body:
{
"bid": float,
"black_list": [text],
"white_list": [text],
"bid_by_source": {text: float, text: float},
"smart_purchase": boolean
}
bid - campaign bidblack_list - blacklist setting (only numbers, "-". Example: 132, 543-123)white_list - whitelist setting (only numbers, "-". Example: 823, 452-33)bid_by_source - bid by source settingsmart_purchase - SmartCPC traffic purchase. Use only for adtype: popunder, inpage{
"code": int,
"message": text,
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/382' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"bid": 0.1,
"smart_purchase": boolean
}'
{
"code": 200,
"message": "Ok",
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/15964' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"bid_by_source": {
"2": 0.1,
"3": 0.2,
"smart_purchase": true
}
}'
{
"code": 200,
"message": "Ok",
"data": null
}
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/382' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
"black_list": [
"1-11",
"111",
"222"
],
"white_list": [
"6-66",
"666",
"777"],
"smart_purchase": true
}'
{
"code": 200,
"message": "Ok",
"data": null
}