To provide user with rewards through Buzzvil products, server-to-server integration between Buzzvil server and publisher’s server is necessary.
Proceed with the following steps:
Establish a server endpoint that can receive requests for reward from Buzzvil (the endpoint is referred as
postback url
)Server-To-Server integration according to this guide
Forward postback url to your account manager
Note |
---|
Please consult with your account manager before proceeding with the integration. |
Index
Table of Contents | ||||
---|---|---|---|---|
|
...
This API is used to send the request to publisher regarding the rewards earned by users via BuzzScreen, BuzzAd and BuzzAd Benefit SDK. Drawio
Content | Details | |||
---|---|---|---|---|
1 | Request Direction | BuzzScreen → Publisher Server | ||
2 | HTTP Request method | POST - application/x-www-form-urlencoded | ||
3 | HTTP Request URL | Defined by publisher | ||
4 | HTTP Request Parameters | Refer to the table below | ||
5 | HTTP Response Code | BuzzScreen determines the success of the request based on the response code received from the publisher.
|
...
Impression ads (impression type → imp)
base reward via Buzzscreen
reward via CPC, CPM type ads
Action type ads (action type → act)
reward via CPY (video), and all action-related ads (when
action_type
isa
)
파라미터 필드(Field) | 타입 | imp 설명 act | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Description
app_key
| O | Identifier for ad inventory.
| |||||||||||||||
| Integer | O | O | The value is the same as that of It’s the same definition of | ||||||||||||||
| String | O | O |
| String | User_id defined by publisher
| ||||||||||||
| String | Use this to prevent duplicate rewards payouts.
| ||||||||||||||||
|
| String | O | O | User_id defined by publisher
| |||||||||||||
| Long | O | O | Campaign id that offered reward points
| ||||||||||||||
| String | O | O | Campaign name that offered reward points
| ||||||||||||||
| Integer | The total reward points rewarded to a user. | ||||||||||||||||
| Long | Unit id set for the Buzzvil ad inventory
| ||||||||||||||||
| String | X | O | The name of the ad a user participated in. | ||||||||||||||
| Integer | O | O | The total reward points rewarded to a user.
| Integer | O | X | Point rewarded to the user to a user at each base point period. If the base point period has not been fulfilled,
| ||||||||||
| Integer | O | O |
| ||||||||||||||
| String | O | O | Type of ad
| ||||||||||||||
action_type
| ||||||||||||||||||
| String | O | The type of action that the user has done in order to get the point.
추후 다양한 타입이 추가될 수 있습니다. | |||||||||||||||
| Long (timestamp) | O | O | The timestamp of the reward event. (UNIX Timestamp)
Mostly, it's the same as the time of API request. However, it could vary in case there was the second trial of request. | ||||||||||||||
| String | O | O | Json serialized strings of campaign data defined by publisher. eg)
| ||||||||||||||
| decimal (18,9) | X | O | The unit price of campaign provide to the publisher | ||||||||||||||
| String | X | O | The value is the same as that of | ||||||||||||||
| String | X | O | The users’s ad id (AOS: Google Ad ID, iOS: IDFA) | ||||||||||||||
| Integer | X | O | The total reward points rewarded to a user (For action type ads) The value is the same as that | ||||||||||||||
| 0 or 1 | X | O |
| ||||||||||||||
| String |
|
| String | Use this parameter when the parameters are encrypted. Please refer to the below for more information.
| |||||||||||||
| String | Use this parameter when Checksum is used.
|
Request Parameter Validation
Status | ||
---|---|---|
|
...
Used to add Checksum parameter to validate the postback data. Data validation method is HMAC verification and it uses SHA-256
algorithm.
...
Requirement
Ask account manager for
hmac_key
. (MAX 64)
Procedure
Create a string called
msg
with parameters(transaction_id
,user_id
,campaign_id
,point
) from the postback as shown below.Note :
msg
has to be encoded and there are no space around each colon.Code Block msg=u'{0}:{1}:{2}:{3}'.format( params['transaction_id'], params['user_id'], params['campaign_id'], params['point'], ).encode('utf-8')
Use HMAC SHA-256 algorithm to encode
msg
.key:
hmac_key
data:
msg
Compare the result value to the value in field
c
from the postback for verficiation.Length of result value: 64 characters
...
2. HTTP Request Parameter Encryption/Decryption
Guide for decrypting data
parameter when HTTP Request Parameter Encryption is enabledThis is used when you want to encrypt the HTTP Request parameter sent from the Buzzvil server to the media company. The encryption method provided is the Advanced Encryption Standard, AES (Advanded Encryption Standard). The provided block encryption is AES-256
, and the used block encryption mode (Block Cipher) uses CBC (Cipher Block Chaning) Mode and PKCS7.
Please follow the process below in order.
Procedure
...
Please request for AES key and IV value to your account manager.
...
Requirement
Ask account manager for
AES Key
(Max 32) andAES IV
(Max 16)
Procedure
Buzzvil server encrypts parameters in the order as follows.
JSON serialized parameters with UTF-8 encoding
AES(CBC mode, PKCS7 padding) encryption
base64 encoding
Encrypted data should be sent as
data
parameter in HTTP POST request.e.g
Code Block language json { "data": "cg087LiIp30jCWpc3MVLfxPL4F05OFGGCkQwwpS6pRVMZhkumzfTFxc8iBoZ8unI15uk0cmY+CbSeOaLHsd7PaxsbyKISiJ31WJJ1OwfaYttoMwFysKNfL7pSz2HB9ULWZicG8MSPxCPKr9RDqgOXpuEoVm9YR3I4yNE5M0LNltpCTdXRBjTrOcjp+RtEZ1VENtHqTICK18nDqO+91BUt3AJsf4VmzogJ8UpA0izEbY=" }
When receiving it,
data
parameter from HTTP POST request should be decrypted as below.base64
decodingAES
decoding JSON loadand removePKCS7
paddingUTF-8
decoding
Example
AES key and IV value in the example are both
12341234asdfasdf
buzzvil123456789
.Example in plaintext
Code Block | ||
---|---|---|
| ||
{ "unit_id":"12345", "transaction_id":"10000000_1", "user_id": "testuserid76301buzzvil", "point": 1, "action_type":"won", "u"event_at": 1599622182, "title":"title", "extra": "{}", "is_media": 0, "point": 2, "campaign_id": 3467, } |
Example in ciphertext
JSON (UTF-8encoding) → AES encryption → base64 encoding
Code Block |
---|
cg087LiIp30jCWpc3MVLfxPL4F05OFGGCkQwwpS6pRVMZhkumzfTFxc8iBoZ8unI15uk0cmY+CbSeOaLHsd7PaxsbyKISiJ31WJJ1OwfaYttoMwFysKNfL7pSz2HB9ULWZicG8MSPxCPKr9RDqgOXpuEoVm9YR3I4yNE5M0LNltpCTdXRBjTrOcjp+RtEZ1VENtHqTICK18nDqO+91BUt3AJsf4VmzogJ8UpA0izEbY= |
decrypted version of the above string is as follow
base64 decoding
Code Block r\r<\xec\xb8\x88\xa7}#\tj\\\xdc\xc5K\x7f\x13\xcb\xe0]98Q\x86\nD0\xc2\x94\xba\xa5\x15Lf\x19.\x9b7\xd3\x17\x17<\x88\x1a\x19\xf2\xe9\xc8\xd7\x9b\xa4\xd1\xc9\x98\xf8&\xd2x\xe6\x8b\x1e\xc7{=\xaclo"\x88J"w\xd5bI\xd4\xec\x1fi\x8bm\xa0\xcc\x05\xca\xc2\x8d|\xbe\xe9K=\x87\x07\xd5\x0bY\x98\x9c\x1b\xc3\x12?\x10\x8f*\xbfQ\x0e\xa8\x0e^\x9b\x84\xa1Y\xbda\x1d\xc8\xe3#D\xe4\xcd\x0b6[i\t7WD\x18\xd3\xac\xe7#\xa7\xe4m\x11\x9dU\x10\xdbG\xa92\x02+_\'\x0e\xa3\xbe\xf7PT\xb7p\t\xb1\xfe\x15\x9b: \'\xc5)\x03H\xb3\x11\xb6
AES decryption) Key, IV:
buzzvil123456789
Code Block {"unit_id": "12345", "transaction_id": "10000000_1", "user_id": "buzzvil", "point": 1, "action_type": "won", "event_at":
...
1599622182, "title": "title", "extra": "{}"}
UTF-8 decoding
Code Block {"unit_id":
...
"12345", "transaction_id": "
...
10000000_1", "user_id": "buzzvil", "point": 1, "
...
action_
...
type":
...
"won", "event_at": 1599622182, "title": "title", "
...
extra":
...
Example in ciphertext
...
"{}"}