Это старая версия документа!
POST http://apiNN.kokids.org/api/init
NN = {01,02}
INPUT
type tInitInput struct {
Bundle string //app id i.e. "com.YovoGames.kidgame"
Offset string //client time offset (i.e. '+0200' ,'+0000', '-1200', '+0530'). see example TimeZoneUtc below
Apk int //bundle code or apk version int
//fillin all possible login data. If you have gaid but not uid -> you'll receive uid,
//if you have uid and loggin from ios -> fill in all data to join accounts in the db
//login by kokids userid and token
Uid int64 //if exist
Token string //if uid>0
//other login method (android device id)
GAID string
GaidType int
//login by ios IDFA
IDFA string
//other login methods will be here
}
OUTPUT
type tInitOutput struct {
Uid int64 //user id in kokids service
Token string //token for auth requests
LastAPK int //previous login apk version (you can check whether was upgrade), 0 - if new client
IsNewDevice int //1 - if new device
Data map[string]any //extra data saved in db
}
private string TimeZoneUtc()
{
string symbol = "+";
TimeSpan tm = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);
if (tm.TotalMinutes < 0)
symbol = "-";
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + symbol + tm.ToString("hhmm");
}