# Update Ad Unit
Interface should be called on the server side, seeHattori API。
# Interface Dxplaination
# Interface name
AgencyUpdateAdunit
# Functional description
this API Used to update the ad unit for the Mini Program. 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=agency_update_adunit&access_token=xxxxxxxxxxxxxxx
# Request parameters
attribute | type | Required | Introductions |
---|---|---|---|
name | string | yes | Advertising Unit Name |
ad_unit_id | string | yes | Ad Unit ID |
status | string | yes | Ad Unit Switch Status: AD_UNIT_STATUS_ON opened, AD_UNIT_STATUS_OFF关闭 |
video_duration_min | number | no | Incentive video ads are required to fill in the minimum value of advertising display time. Currently Available Value: 6 |
video_duration_max | number | no | Incentive video ads are required to fill in the maximum value of advertising display time. Currently Optional Value: 15/30/60 |
TMPL_type | number | no | Native templates required tmpl_type或tmpl_id。 Method 1: tmpl_type Select the fixed template style, the current selectable values: 6 vertical version above below, 7 vertical version above below, 12 vertical version above below overlay A, 13 vertical version of the above picture below superimposed B, 2 banner above below, 3 banner below above, 4 horizontal plate above below superimposed A, 11 horizontal plate above below superimposed B, 9 banner left right, 10 banner right left, 20 banner single, 100001 single grid without animation, 100003 multi-grid without carousel |
TMPL_id | string | no | Native template template required tmpl_type或tmpl_id。 Method 2: Customize the template, fill in the [third-party platform ->Cash Out Zone ->Custom created template ID in Native Template Management. See:Service Provider - Native Template Editing Capability Guide |
# Return parameters
attribute | type | Introductions |
---|---|---|
ret | number | Error code |
err_msg | string | Error message |
# Other Notes
# Advertisement Type Name Dxplaination
Name of type ad_slot/type) | Type of advertising space |
---|---|
SLOT_ID_WEAPP_初始值 | Mini Program banner |
SLOT_ID_WEAPP_REWARD_VIDEO | Mini Program Motivational Video |
SLOT_ID_WEAPP_INTERSTITIAL | Mini Program Screen Advertising |
SLOT_ID_WEAPP_VIDEO_FEEDS | Mini Program Video Ads |
SLOT_ID_WEAPP_VIDEO_BEGIN | Mini Program video patch ads |
SLOT_ID_WEAPP_TEMPLATE | Mini Program template advertisement |
# Call Example
Example Dxplaination: The banner is wide:
# Sample Request Data
{
"name": "Test Ad Unit,"
"ad_unit_id": "adnit-04a286aed8xxxx"
"status": "AD_UNIT_STATUS_ON "
}
# Return Data Example
{
"ret": 0,
"err_msg":""
}
Example Dxplaination: Motivational Video Advertising Space:
# Sample Request Data
{
"name": "Test Ad Unit,"
"ad_unit_id": "adnit-04a286aed8xxxx"
"status": "AD_UNIT_STATUS_ON",
" video_duration_min": 6,
" video_duration_max": 30
}
# Return Data Example
{
"ret": 0,
"err_msg":""
}
Example Dxplaination: Native Template Ad Space:
# Sample Request Data
{
"name": "Test Ad Unit,"
"ad_unit_id": "adnit-04a286aed8xxxx"
"status": "AD_UNIT_STATUS_ON",
"tmpl_type": 6
}
# Return Data Example
{
"ret": 0,
"err_msg":""
}
# 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 |
1803 | Ad Unit Name Repeat | Modify the Ad Unit Name Entered |
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 |