Youmi android offers order callback protocol en
Youmi Android OfferWall Server Callback Protocol
- This document is used for Android platform. For iOS platform, please refer to here:iOS Rewarded Offerwall Server Callback Interface。
- The uniform encoding of interface: UTF-8
- Be suited to developers who use their own server to manage currency points.
- Once Youmi gets the feedback data from advertisers, we will report back to developers' server immediately.
- It will need developers to offer an interface to receive data. The method for interface to receive data: GET.
- evelopers will set up the currency points feedback address in Youmi's developer background control panel, eg: https://app.youmi.net/apps/setting
- Once Youmi's server receives an effective data record, it will feedback to developers' server (with GET method) with the feedback url address which is offered by developers. Relevant parameters will be will plus to the url address as below.
|Full Name||Brief Name||Type||Statement|
|Order ID||order||string(18 bytes)||Order ID: This value is unique. If developer receives the same order ID, that means the order is already existed.|
|App ID||app||string(16 bytes)||The Application ID|
|Ad Name||ad||string(50 bytes)||The advertisement name. If the ad type is app, then the ad name is the application's name|
|User ID||user||string(256 bytes)||User ID: Developers can set up their own user ID. For example, if developers' apps have the login function, then user ID can be used to replace the CID identification which is offered by Youmi. (Youmi will generate an identification number for each device) Otherwise, Youmi will use CID as user ID. <br/Notes: The parameters and processed by urlencode. Please use urldecode to acquire the original parameters.|
|Points||points||int|| The currency points that users can earn.|
If this value is 0, that means user won't get the currency points due to some reasons. For example, users already exceed the limited activation number.
|Signature||sig||string(8 bytes)|| Parameters signature, the signature algorithm as below. |
This value is used for verify the integrity of the above parameters, to prevent the third party to tamper with them.
The parameters which are not involved in signature:
|Full Name||Brief Name||Type||Statement|
|Package Name||pkg||String||App Package Name|
|Device ID||device||string|| Device ID：imei for android|
Notes: The parameters and processed by urlencode. Please use urldecode to acquire the original parameters.
|Time||time||int||The time when have an affect|
|Price||price||float||The revenue can be obtained by the application|
$sig = substr(md5($dev_server_secret . "||" . $order . "||" . $app . "||" . $user . "||" . $chn . "||" . $ad . "||" . $points), 12, 8);
String sig = md5(dev_server_secret + "||" + order + "||" + app + "||" + user + "||" + chn + "||" + ad + "||" + points).substring(12, 20);
String input=dev_server_secret + "||" + order + "||" + app + "||" + user + "||" + chn + "||" + ad + "||" + points; byte buff=Encoding.UTF8.GetBytes(input); String sig = md5(buff).Substring(12, 8);
- $dev_server_secret: The secret key from developers' server, offered by Youmi. Enter this page "https://app.youmi.net/apps/setting" after logging, find the rewarded ads callback method setting-server callback setting, and set up the server address. After successfully setting, a secret key will be assigned to your app.
- $order: The parameter order in interface, like the others parameters.
- $user、$ad、$device：It is the original parameters which are involved in signature. It will use urlencode when transferring. So you should use original parameters when verifying sig.
Verification of signature parameters
Statements:In the early stage of integrating advertisement SDK, developers might find it fail to pass the verification, then this verification interface will be needed to verify. Of course, you can also contact our customer service directly. Normal verification logic will be implemented by developers themselves.
Supposed that developers receive the feedback request from Youmi is:
- Youmi will proceed the next operation according to the returning http status code from developers' server. The normal http status code should be 200 or 403.
- If the http status code is 200, that means developers already received and processed the message normally.
- If the http status code is 403, that means developers refuse this request, which also means middle-tier server will not repeatedly make request to developers' server.
- If timeout, or the http status code isn't one of 2xx, 301, 302, 303, 307, 400 and 403, the middle-tier server will make request to developers' server again in the next cycle.
- There will be delays in the next cycle request to developers' server, the delay time will respectively be: 5s, 10s, 60s, 300s, 600s, 3600s(since last request). Which means, in the worst case, Youmi will send seven requests. If all of the seven requests fail, the link will be discarded.
- Because of network issues or other reasons, developers' server will receive multiple records with the same order ID. In this case, developers' server need to abandon the duplicate records, and output with http status code 403.