Menu

Adsource API (Expired)

1. Batch Create and Update Adsource

Notice: When creating the source of a new network under the application, you need to call the APP API1  to create the Publisher and App dimension parameters of the new network.

1.1 Request URL

https://api.toponad.net/v1/set_units

1.2 Request method

POST

1.3 Request params

params type required notes
count Int Y adsource number
ecpm_currency String N ecpm currency unit, default USD when not transmitting, optional CNY
units Array Y -
units.network_id Int Y account id,this id can be obtained through the section 8.2 interface
units.adsource_id Int N adsource id,it must be passed on when it is updated
units.adsource_name String Y adsource name
units.adsource_token Object Y network unit params.See the appendix (Detailed parameters of network)
units.placement_id String Y TopOn placemtne id
units.default_ecpm String Y adsource default ecpm
units.header_bidding_switch Int N

1: off(default),

2: on

1.4 Return data

fields type required notes
units Array[Object] Y -
units.network_id Int Y Network Account ID, which can be obtained through the interface in section 8.2
units.adsource_id Int N Ad source ID, must be passed when modifying
units.adsource_name String Y Ad source Name
units.adsource_token Object Y Ad source parameters, see Appendix 3 specifications for details
units.placement_id String Y TopOn’s placement ID
units.default_ecpm String Y Ad source default price
units.header_bidding_switch Int N 1: Not supported (default)
2: Indicates support
units.errors String N Error message when there is an error in creating or modifying the ad source, empty when the operation is successful
units.ecpm_currency String Y eCPM currency, corresponding to the parameter ecpm_currency when requesting, the default is USD when not transmitting

1.5 Sample

Request sample:

{
    "count": 2,
    "units": [
        {
            "network_id": 307,
            "adsource_name": "5234",
            "adsource_token": {
                "unit_id": "fasfasf",
                "is_video": "0",
                "personalized_template": "1",
                "size": "320x50",
                "layout_type": "1"
            },
            "placement_id": "b5bc993ab0966a",
            "default_ecpm": "69"
        },
        {
            "network_id": 225,
            "adsource_name": "5234",
            "adsource_id": 19759,
            "adsource_token": {
                "slot_id": "fasfasf",
                "is_video": "0",
                "personalized_template": "1",
                "size": "640x100",
                "layout_type": "1"
            },
            "placement_id": "b5bc993ab0966a",
            "default_ecpm": "69"
        }
    ]
}

Return sample: 

[
    {
        "network_id": 307,
        "adsource_id": 19743,
        "adsource_name": "23423423423",
        "adsource_token": {
            "size": "sdsd",
            "unit_id": "xcxc"
        },
        "placement_id": "12312312",
        "default_ecpm": "",
        "errors": "adsource_id error"
    },
    {
        "network_id": 307,
        "adsource_name": "asfdasdasd",
        "adsource_token": {
            "size": "asfasd",
            "unit_id": "asdasdafsdddd"
        },
        "placement_id": "123123123",
        "default_ecpm": "",
        "errors": "ad_source_name repeated"
    }
]

2. Get Adsource list

2.1 Request URL

https://api.toponad.net/v1/units

2.2 Request method

POST

2.3 Request params

params type required notes
network_firm_ids Array[Int] N Multiple values are supported
app_ids Array[String] N Multiple values are supported
placement_ids Array[String] N Multiple values are supported
adsource_ids Array[Int] N Multiple values are supported
start Int N Default value: 0 (cannot be used with the above parameters)
limit Int N Default value: 100, and the maximum is 100 at a time (cannot be used with the above parameters)
metrics Array[String] N Specify the returned fields from the ad_source_list. If you do not pass, all of them will be returned
ecpm_currency String N eCPM currency unit, default USD when not transmitting, optional CNY

2.4 Return data

fields type required notes
network_id String N Account id
network_name String N Account name
nw_firm_id Int N Network Firm ID
adsource_id Int N Adsource ID
adsource_name String N Adsource name
adsource_token Object N Adsource params
app_id String N TopOn App ID
app_name String N TopOn App name
platform Int N Platform
placement_id String N TopOn placement id
placement_name Object N TopOn placement name
placement_format String N Adformat
ecpm_currency String Y eCPM currency unit, corresponding to the parameter ecpm_currency when requesting, the default is USD when not transmitting
waterfall_list Array[Object] N The waterfall of adsource is being used
waterfall_list.ecpm String N Adsource eCPM
waterfall_list.auto_ecpm String N Adsource auto eCPM
waterfall_list.header_bidding_switch Int N Header bidding switch
waterfall_list.auto_switch Int N Auto ecpm switch
waterfall_list.day_cap Int N Day cap
waterfall_list.hour_cap Int N Hour cap
waterfall_list.pacing Int N Pacing
waterfall_list.segment_name String N Segment name
waterfall_list.segment_id Int N Segment ID
waterfall_list.parallel_request_number Int N Parallel request number
waterfall_list.is_abtest Int N Whether it is a test group, default: 0
0: control group, 1: test group
waterfall_list.mediation_group_id Int N Mediation Group ID
waterfall_list.remark String N Remarks of ad source + traffic group dimension

2.5 Sample

Request sample:

{
    "adsource_ids":[19683]
}

Return sample: 

[
    {
        "nw_firm_id": 12,
        "network_name": "Default",
        "adsource_id": 19683,
        "adsource_name": "Unity Ads_int_2",
        "adsource_token": {
            "game_id": "234234",
            "placement_id": "23434"
        },
        "app_id": "232323",
        "app_name": "234234",
        "platform": 2,
        "placement_id": "234234234234",
        "placement_name": "234234234",
        "placement_format": "3",
        "waterfall_list": [
            {
                "ecpm": "1",
                "auto_ecpm": "",
                "header_bidding_switch": 1,
                "auto_switch": 1,
                "day_cap": 0,
                "hour_cap": 0,
                "pacing": 0,
                "name": "日韩",
                "segment_id": 123,
                "priority": 3,
                "parallel_request_number": 2
            },
            {
                "ecpm": "2",
                "auto_ecpm": "",
                "header_bidding_switch": 1,
                "auto_switch": 1,
                "day_cap": -1,
                "hour_cap": -1,
                "pacing": -1,
                "name": "ipad",
                "segment_id": 456,
                "priority": 2,
                "parallel_request_number": 2
            }
        ]
    }
]

3. Batch Delete Adsource

3.1 Request URL

https://api.toponad.net/v1/del_units

3.2 Request method

POST

3.3 Request params

params type required notes
adsource_ids Array[Int] Y Adsource ID

3.4 Return data

fields type required notes
msg String N Result message

3.5 Sample

Request sample:

{
    "adsource_ids":[19683]
}

Return sample:

{
    "msg": "suc"
}
Previous
Network API
Next
Adsource API (v3)
Last modified: 2025-08-21Powered by