# Get native template ads custom template bindings

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

GetAgencyTmplIdList

# Functional description

this API Use to query a list of ad units bound to a native template custom created by the service provider. If you encounter problems during use, you canOpen Platform Service Provider Zone Exchange Zone | WeChat Open CommunityPosting exchanges.

# Note

Where access_Token forauthorizer_access_Token

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/wxa/operationams?action=get_agency_ad_unit_list&access_token=xxxxxxxxxxxxxxx 

# Request parameters

attribute type Required Introductions
page number yes Return to Page Number of Data
page_size number yes When the page returns the number of data bars
ad_slot string yes Ad Space Type Name
TMPL_id string no Template Ad Unit ID
is_return_TMPL_bind_list number no Whether to return merchant ad unit information bound by the template ad unit ID

# Return parameters

attribute typeIntroductions
ret number Error code
err_msg string Error message
total_num number Total Template Ad Unit Data Volume for Service Provider
ad_unit_list array ad_unit_list
attribute type Introductions
TMPL_id string Template Ad ID
ad_unit_name string Template Ad Unit Name
slot_id string Ad Space Type Name
TMPL_bind_total_num number The number of merchant ad units that the template ad unit is bound to
TMPL_bind_list array TMPL_bind_list
attribute type Introductions
ad_slot string Ad Space Type Name
ad_unit_id string Ad Unit ID
ad_unit_name string Advertising Unit Name
ad_unit_size object Ad Unit Size
attribute type Introductions
ad_unit_status number Ad Unit Switch Status 1: Open 2: Off
video_duration_max number Maximum value of advertisement display time
video_duration_min number Minimum value of advertisement display time

# Other Notes

1, when only need to obtain the native template ad custom template information, do not need to pass ad_unit_id及is_return_TMPL_bind_list parametersWhen you need to get the merchant ad unit information for a custom template binding, you need to pass ad_unit_id及is_return_TMPL_bind_List parameter. The returned list of ad units is in reverse chronological order and is retrieved by the user as a pagination.

# Call Example

Example Dxplaination: Get Template Ad Unit Information Request Data Example:

# Sample Request Data


{
    "page": 1,
    "page_size": 8,
    "ad_slot": "SLOT_ID_WEAPP_TEMPLATE"
} 

# Return Data Example


{
   "right": 0,
    "err_msg": "",
    "ad_unit_list":[
        {
            "tmpl_id": "adnit-e9418ee19XXXXX"
            "ad_unit_name": "",
            "ad_slot": ""
        },
        {
            "tmpl_id": "adnit-e9418ee19XXXXX"
            "ad_unit_name": "",
            "ad_slot": ""
        }
    ],
    "total_number:2
} 

Example Dxplaination: Get Ad Unit Information Request Data for a Specified Template Ad Unit Binding Merchant:

# Sample Request Data


{
    "page": 1,
    "page_size": 8,
    "ad_slot": "SLOT_ID_WEAPP_TEMPLATE",
    "tmpl_id": "adnit-44e668410cxxxx"
    "is_return_TMPL_bind_list": 1
} 

# Return Data Example


{
   "right": 0,
    "err_msg": "",
    "ad_unit_list":[
        "tmpl_id": "adnit-e9418ee19XXXXX"
        "ad_unit_name": "",
        "tmpl_text": "",
        "slot_id": "SLOT_ID_WEAPP_TEMPLATE",
        "tmpl_bind_list": [{
                "ad_slot":"SLOT_ID_WEAPP_TEMPLATE",
                "ad_unit_id":"adunit-e9XXXXXXXXXXXX",
                "ad_unit_name":"rewaXXXX",
                "ad_unit_size":[
                    {
                        "height":166,
                        "width":582
                    }
                ],
                "ad_unit_status:
                "ad_unit_type":"AD_UNIT_TYPE_TEMPLATE_CUSTOM",
                "appid":"wx0afc78670fXXXX"
                " video_duration_max":30,
                " video_duration_min:6
            }
        ],
        "tmpl_bind_total_num": 1
    ],
    "total_number: 1
} 

# Error code

Error code Error code Solutions
0 ok ok
-202 Internal error Can be retried after some time
1700 Parameter error Verify that the input parameters conform to the documentation
1701 Parameter error Verify that the input parameters conform to the documentation
1735 The merchant has not completed the agreement signing process Complete the signing operation
1737 Operating too fast Wait a minute and reoperate
1807 Invalid Flow Master Turn on the traffic master for this appid through the turn on traffic master interface
2009 Invalid Flow Master Turn on the traffic master for this appid through the turn on traffic master interface
2056 The service provider does not open an account in the cash area Launch services in the monetization area of the third-party platform page