1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
Description: Sent when client opens Downloader
Request: ID, CountriesV, PurchasesV
{
"ID":"12345", // unique client id
"Cmd":"VersionCheck",
"Params":
{
"CountriesV":1, // local version of countries file on the client
"PurchasesV":1, // local version of purchases file on the client
"ClientV":1 // client version
}
}
Response: Credit [, CountriesV, Countries, PurchasesV, Purchases]
{
"Credit":10, // current credit for the client
"CountriesV":2, // optional, latest version of countries list
"Countries":{...}, // optional, latest countries list with new prices and new countries
"PurchasesV":2, // optional, latest inapp purchases list version
"Purchases":["123","456","789"] // optional, latest inapp purchases IDS
}
Description: Sent by client to validate payment and add credits
Request: ID, Receipt
{
"ID":"12345",
"Cmd":"ValidatePayment",
"Params":
{
"Receipt":"ASD24@#$!@$%" // base 64 encoded app store receipt to validate and store on our server
}
}
Response: Credit [, Error]
{
"Credit":23, // current credit for the client
"Error":"Invalid purchase receipt" // optional, sent if receipt was not validated by Apple server
}
Description: Sent by client to add some credit by entering friend promo code or any other public promo code
Request: ID, Code
{
"ID":"12345",
"Cmd":"ValidatePromoCode",
"Params":
{
"Code":"123asdREWR24ad"
}
}
Response: Credit [, Error]
{
"Credit":27, // current credit for the client
"Error":"Promo Code is already used" // optional, sent if promo code is invalid
}
Description: Sent by client when he tries to download the country file
Request: ID, Version, File, Size
{
"ID":"12345",
"Cmd":"Download",
"Params":
{
"Version":110920,
"File":"Belarus.mwm",
"Size":47123456
}
}
Response: File[, Urls | Error]
{
"File":"Belarus.mwm",
"Urls":["http://blablalba.com/casd/234dsf","http://asd.com/fda/qwert"], // special urls valid only for this client to download given file
"Error":"Invalid file or no credit" // sent if no credit is left instead of Urls
}
Description: Client requests own "Bring friend" code once, which should be entered as Promo code by any friend
Request: ID, FriendCode
{
"ID":"12345",
"Cmd":"FriendCode",
}
Response: FriendCode
{
"FriendCode":"ASDF123Gsdf342" // unique promo code for this client, to bring his friends
}
|