Server-to-Server: allows developers to decide whether to issue rewards to users who watch reward videos. When the user watches the reward video, the developer's server will be notified, and the developer will issue the reward itself
Note: In order to ensure the accuracy of server-side rewards, developers are recommended to use the server-side reward callbacks of third-party advertising platforms first. For TopOn Adx, direct investment, and cross-promotion, developers can directly use TopOn's server-side reward callbacks. You can determine whether to accept only TopOn server-side reward callbacks based on the Network Firm ID:
The advertising platforms that support server-side rewards are as follows : (You can click to jump to the advertising platform’s documentation on server-side rewards. If you cannot jump, please log in to the advertising platform backend directly to set the callback URL)
1. Developer needs Turn on the server-side reward for the rewarded video ad space in the TopOn backend, and set the developer's server-side reward Callback URL, the example is as follows:

2. Developer's Callback URL an example is as follows:
https://www.toponad.com/onrewardedverify?user_id={user_id}&trans_id={trans_id}&reward_amount={reward_amount}&reward_name={reward_name}&placement_id={placement_id}&extra_data={extra_data}&network_firm_id={network_firm_id}&adsource_id={adsource_id}&scenario_id={scenario_id}&sign={sign}&ilrd={ilrd}3.TopOn will request the developer's GET method Callback URL, and splice the following parameters back:
user_id={user_id}&trans_id={trans_id}&reward_amount={reward_amount}&reward_name={reward_name}&placement_id={placement_id}&extra_data={extra_data}&network_firm_id={network_firm_id}&adsource_id={adsource_id}&scenario_id={scenario_id}&sign={sign}&ilrd={ilrd}| Parameter | Description | Remarks |
|---|---|---|
| {user_id} | User ID | Set by the developer through the TopOn SDK API |
| {extra_data} | User business parameters | Set by the developer through the TopOn SDK API |
| {trans_id} | The trans_id generated by the TopOn server is unique | It is strongly recommended that developers verify whether trans_id has been issued rewards before the server issues rewards to ensure Avoid repeated issuance of rewards to the same trans_id |
| {reward_name} | reward name | Set in the developer backend ( Supports advertising slot or Advertising scene settings) |
| {reward_amount} | reward quantity | Set in the developer backend ( Supports advertising slot or Advertising scene settings) |
| {placement_id} | TopOn ad slot ID | - |
| {network_firm_id} | TopOn aggregated advertising platform ID | [Special attention] 1). If you need to use server-side rewards while using TopOn Adx, direct investment, and cross-promotion: For third-party advertising platforms, it is recommended that you give priority to the server-side reward callbacks of the third-party advertising platform; for TopOn Adx, direct investment, and cross-promotion, You can use TopOn's server-side reward callbacks. 2). You can determine whether to only accept TopOn server-side reward callbacks based on the Network Firm ID: 1. Network Firm ID of TopOn Adx=66 2. Network Firm ID of TopOn direct advertising= 67 3.TopOn cross-promotion Network Firm ID=35 View TopOn advertising platform ID list |
| {adsource_id} | TopOn ad source ID | - |
| {scenario_id} | TopOn advertising scene ID | Set by developer through TopOn SDK API |
| {package_name} | The package name or Bundle ID of the developer's application | Get the developer's application package name or Bundle ID from TopOn SDK |
| { platform} | System platform, Android or iOS | Return according to the following enumeration types, 1: Android, 2: iOS |
| {ilrd} | Display-level data for TopOn SDK callback. Data For json string | TopOn SDK v5.7.78 and above are supported. TopOn SDK provides developers with display-level data when calling back reward video OnReward. Specific data format reference |
| {sign} | Signature information | Reference signature rule description |
4. Explanation of signature rules
When developers receive TopOn's server-side reward callback, they can verify the callback parameters through sign.
sign =MD5("trans_id="+trans_id+"&placement_id="+placement_id+"&adsource_id="+adsource_id+"&reward_amount="+reward_amount+"&reward_name="+reward_name+"&sec_key="+sec_key)sign =MD5("trans_id="+trans_id+"&placement_id="+placement_id+"&adsource_id="+adsource_id+"&reward_amount="+reward_amount+"&reward_name="+reward_name+"&sec_key="+sec_key+"&ilrd="+ilrd)| Parameters | Example |
|---|---|
| trans_id | xxxxxxxxxxxxxxxx |
| placement_id | b5b449fb3d89d7 |
| adsource_id | 56789 |
| reward_amount | 1 |
| reward_name | coin |
| sec_key | cyvmwmzrqts7csphhexpqxqxxgljfisb |
| ilrd | abc |
sign signature example As follows:
sign=MD5(trans_id=xxxxxxxxxxxxxxxx&placement_id=b5b449fb3d89d7&adsource_id=56789&reward_amount=1&reward_name=coin&sec_key=cyvmwmzrqts7csphhexpqxqxxgljfisb&ilrd=abc)5. After the developer's callback URL receives TopOn's server-side reward callback, it needs to give TopOn The server returns status code 200 or 601 or 602. After TopOn receives the success or failure status code, it will not resend the server-side reward callback
| Return status code | Description |
|---|---|
| 200 | Success |
| 601 | Signature verification failed |
| 602 | Other failures |
6. If there is no response within 2 seconds after the TopOn server initiates the server-side reward callback, it will be considered a timeout. , after timeout, the reward callback will be retried every once in a while (such as 2 seconds, 4 seconds, 8 seconds, etc.). If TopOn retries for a maximum of 5 times and times out, it will no longer initiate an reward callback to the developer callback URL
In order to satisfy developers in issuing different rewards under different rewarded video advertising scenarios , TopOn allows developers to set different reward names and reward amounts in different advertising scenarios. The specific usage process is as follows:
1. Open the rewarded video advertising space The server fires the callback and receives the TopOn callback in Callback URLAdvertising scene ID{scenario_id}
2. In TopOn In the background advertising scene, set reward quantity and reward name, refer to the following:

3. When the developer receives TopOn's server-side reward callback, the developer will use the advertising scene ID{scenario_id} distribute different rewards
In order to reduce the time developers spend manually configuring server callback rules, TopOn allows developers to quickly reuse server callback rules. The steps are as follows:
1. In Advanced functions In the drop-down interface, enter Server callback
2. Create a new Callback rule and save the rule after editing.

3. When creating or modifying an ad slot, open the server callback button and select the corresponding rule, that is Quick reuse of this rule can be achieved.

Map<String, Object> localMap = new HashMap<>();
localMap.put(ATAdConst.KEY.USER_ID, "test_user_id");
localMap.put(ATAdConst.KEY.USER_CUSTOM_DATA, "test_user_data");
mRewardVideoAd.setLocalExtra(localMap);
mRewardVideoAd.load();[[ATAdManager sharedManager] loadADWithPlacementID:placementId extra:@{
kATAdLoadingExtraMediaExtraKey:@"test_user_data",
kATAdLoadingExtraUserIDKey:@"test_user_id"}
delegate:self];Dictionary<string,string> jsonmap = new Dictionary<string,string>();
jsonmap.Add(ATConst.USERID_KEY, "test_user_id");
jsonmap.Add(ATConst.USER_EXTRA_DATA, "test_user_data");
ATRewardedVideo.Instance.loadVideoAd(placementId, jsonmap);cocos2d::ValueMap extra;
extra[ATCocosSdk::KEY_USER_ID] = "test_user_id";
extra[ATCocosSdk::KEY_MEDIA_EXT] = "test_user_data";
ATCocosSdk::loadRewardedVideoAd(placementId, extra);var setting = {};
setting[ATRewardedVideoJSSDK.userIdKey] = "test_user_id";
setting[ATRewardedVideoJSSDK.userDataKey] = "test_user_data";
ATRewardedVideoJSSDK.loadRewardedVideo(placementId, setting);var setting = {};
settings[ATRewardedVideoRNSDK.userIdKey] = "test_user_id";
settings[ATRewardedVideoRNSDK.userDataKey] = "test_user_data";
ATRewardedVideoRNSDK.loadAd(placementId, settings);| Variable | Type | Description |
|---|---|---|
| network_firm_id | int | Get the corresponding information of the advertising platform ID, used to distinguish advertising platforms |
| adsource_id | string | Get the advertising source ID. You can use the advertising source ID in the developer backend or TopOn Open API Query specific Network information |
| adsource_index | int | Get the sorting of the current advertising source in WaterFall(starting from 0) |
| adsource_price | dounble | Get ECPM , the unit can be obtained through "currency" |
| adsource_isheaderbidding | int | Whether it is the advertising source for header bidding, 1: Yes, 2: No |
| id | string | Get every time independent ID generated when displaying ads |
| publisher_revenue | double | Get impression revenue |
| currency | string | Get the currency unit, for example: "USD" |
| country | string | Get the country code, for example: "CN" |
| adunit_id | string | Get TopOn ad slot ID |
| adunit_format | string | Get the ad type, including: " Native", "RewardedVideo", "Banner" "Interstitial", "Splash" |
| precision | string | Get ECPM accuracy "publisher_defined": The eCPM defined by the developer for the advertising source in the TopOn backend (eCPM for interactive promotion also belongs to this type) "estimated": TopOn's estimated eCPM (auto eCPM) "exact": eCPM of Header Bidding real-time bidding |
| network_type | string | Get Network type "Network": Third-party advertising platform "Cross_Promotion": Cross-promotion "Adx":TopOn Adx |
| network_placement_id | string | Get Network's advertising space ID |
| ecpm_level | int | Get the eCPM level of the advertising source, The header bidding ad source defaults to 0 |
| segment_id | int | Get the traffic group ID |
| scenario_id | string | Get the advertising scene ID, Only supported by Rewarded Video&Interstitial (starting from v5.7.20, supports Native&Banner) |
| scenario_reward_name | string | Get the reward name of the advertising scene, Only supported by Rewarded Video |
| scenario_reward_number | int | Get the reward number of the advertising scene, Only supported by Rewarded Video |
| sub_channel | string | Get sub-channel information |
| channel | string | Get channel information |
| custom_rule | Dictionary<string,object> | Gets a Json string of custom rules for the Placement+App dimension |