Functions
SDK
All "timestamp" in parameters have to present Server time measured as Unix timestamps in milliseconds and have (long) type.
See more here.
CustomerRegistrationPost
Description | Customer's device registration | ||||||
---|---|---|---|---|---|---|---|
Call conditions | Onetime call at first start | ||||||
HTTP Method | POST | ||||||
Parameters |
| ||||||
Parameters example | |||||||
Response | (GUID) SDKInstanceID (long) ServerTimestamp |
CustomerDisableAtHisRequestPost
Description | Customer device registration freezes by her/his own request ("I don't like to receive something like that anymore") Receives extra options to illuminate disabling by mistake | ||||||||
---|---|---|---|---|---|---|---|---|---|
Call conditions | - | ||||||||
HTTP Method | POST | ||||||||
Parameters |
| ||||||||
Parameters example | |||||||||
Response | NO |
CustomerLocationPost
Description | Sends customer location GEO info sending to check entrance to radius | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | - | ||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||
Parameters |
| ||||||||||||||||||||||||
Parameters example | |||||||||||||||||||||||||
Response | ServerToClient message list (opt.) (long) ServerTimestamp |
FenceListGet
Description | Returns actual radius list for current region | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | FenceListProposalGet message was received from server | ||||||||||||
HTTP Method | GET | ||||||||||||
Parameters | (GUID) SDKInstanceID | ||||||||||||
Response |
| ||||||||||||
Response example |
HotGet
Description | Gets information about advert offer | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | HotProposalGet message was received from server | ||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||
Parameters | (GUID) SDKInstanceID | ||||||||||||||||||||||||||||||||||||||||||||||
Response |
| ||||||||||||||||||||||||||||||||||||||||||||||
Response example |
SocialNetworkDataPost
Description | Sends nameless info to server | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | SocialNetworkDataRequestPost message was received from server or current App was white labeled by techsupport | ||||||||||||||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||||||||||||||
Parameters |
| ||||||||||||||||||||||||||||||||||||
Parameters example | |||||||||||||||||||||||||||||||||||||
Response | (long) ServerTimestamp |
EventPost
Description | Sends customer events to server | ||||||||
---|---|---|---|---|---|---|---|---|---|
Call conditions | - | ||||||||
HTTP Method | POST | ||||||||
Parameters |
| ||||||||
Parameters example | |||||||||
Response | ServerToClient message list (opt.) (long) ServerTimestamp |
HotStatusPost
Description | Sends hot's status to server (as soon as possible after change status) | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | HotID exists | ||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||
Parameters |
| ||||||||||||||||||||||||
Parameters example | |||||||||||||||||||||||||
Response | ServerToClient message list (if there are messages) (long) ServerTimestamp |
DebugLogPost
Description | Debug function | ||||
---|---|---|---|---|---|
Call conditions | - | ||||
HTTP Method | POST | ||||
Parameters |
| ||||
Parameters example | { "SDKInstanceID": "6F8GBD99-C8E8-4722-A5DB-DD5BCFF36BF2", "Log": "test log" } | ||||
Response | ServerToClient message list (opt.) (long) ServerTimestamp |
CustomerApplicationsPost
Description | Sends customer Applications to server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Call conditions | CustomerApplicationDataRequestPost message was received from server or current App was white labeled by techsupport | ||||||||||||
HTTP Method | POST | ||||||||||||
Parameters |
| ||||||||||||
Parameters example | |||||||||||||
Response | ServerToClient message list (opt.) (long) ServerTimestamp |
AdditionalInfoList (any function optional add-on structure)
Description | "AdditionalInfoList" |
---|---|
Stcructure | AdditionalInfoList: [ { "AdditionalInfoType": "ChargingState", "Status": "String (POWER_CONNECTED/POWER_DISCONNECTED)", "Plug": "String (BATTERY_PLUGGED_USB/BATTERY_PLUGGED_AC)", "InfoTimestamp": "Long" (joined with CustomerLocationPost by timestamp! Unix timestamps in milliseconds.) }, { "AdditionalInfoType": "ChargingState", "Status": "String (POWER_CONNECTED/POWER_DISCONNECTED)", "Plug": "String (BATTERY_PLUGGED_USB/BATTERY_PLUGGED_AC)", "InfoTimestamp": "Long" (joined with CustomerLocationPost by timestamp! Unix timestamps in milliseconds.) } ] |
Электроскидка only
QOSPost
Description | Sends QOS information from customer (any number of times per one Hot) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Call conditions | HotID exists | ||||||||
HTTP Method | POST | ||||||||
Parameters |
| ||||||||
Parameters example | |||||||||
Response | NO |
DOSPost
Description | Sends DOS information from customer (only one time per one Hot) |
---|---|
Call conditions | HotID exists and has "Viewed" HotStatusType |
HTTP Method | POST |
Parameters | |
Parameters example | |
Response | NO |
ServerToClient Messages
Server's functions marked by "Call conditions" can't be called by client on his own initiative. A special message (proposal or request) must be received by client previously.
Purpose: some kind of security check and DDOS illumination.
Any function except:
- CustomerRegistrationPost,
- CustomerDisableAtHisRequest,
- SocialNetworkDataRequestPost,
- QOSPost,
- DOSPost
may return MessageList response.
Message Type
Type | Description |
---|---|
Proposal | Server proposes client app to receive some information by server's GET function call; after ExpDateTime expires, server'll forget about that. |
Request | Server proposes client app to send some information by server's POST function call; after ExpDateTime expires, server'll forget about that. |
Command | Server gives command to client to do something; server sure that any client application must to do id and does not do any checks. |
Messages
Type | Name | Parameter | Description | When send from server to client | MessageTypeID (internal) |
---|---|---|---|---|---|
proposal | FenceListProposalGet | ExpDateTime | Proposal to client get fence set from server | After registration: at the next time of CustomerLocationPost | 1 |
proposal | HotProposalGet | ExpDateTime | Proposal to client get hot from server | When server determines that the user is within range and there is a offer for him | 2 |
command | ClientQueueResetCommand | n/a | Reset client's commands queue totally to prevent server DDOS | Decision on the server | 3 |
command | CriticalLogCollectCommand | n/a | Start critical information collecting during 7 days and sent it to server | Decision on the server | 5 |
request | SocialNetworkDataRequestPost | ExpDateTime | Request to client send social network profile to server | After registration: at the next time of CustomerLocationPost | 4 |
request | CustomerApplicationDataRequestPost | ExpDateTime | Request to client send device's application list (not marked as system) to server | After registration: at the next time of CustomerLocationPost Later: once a 15 days | 6 |
MessageList response
MessageList:[ {MsgName : "Name1", ExpDateTime:"(long WUnix )"}, ... {MsgName : "NameN", ExpDateTime:"(long WUnix )"} ]
Error Codes
If there are any error on Server side due to execution REST functions server will return HTTP StatusCode = 403 and ErrorList in response
{"ErrorList":[{"ErrorDescription":"Invalid SDKInstanceID (or Customer disabled )"}]}
6 Comments
Anton Sotniychuk
Grigory Petrov, Vladimir Samoylov: please check new function CustomerDisableAtHisRequest
Vladimir Samoylov
For QOSPost - OK.
For CustomerDisableAtHisRequest:
Grigory Petrov
2. Зачем CustomerDisableAtHisRequest параметр DeviceName в принципе?
Anton Sotniychuk
>So, if I undersand correctrly, we just check DeviceName value (NULLABLE) with value wich was send due to CustomerRegistrationPost (or NOT send = NULL).
Yes
> Response - is absent in this function (add to formal documentation)
I'm not so sure. In future we could try to receive additional information from client before disabling.
Vladimir Samoylov
To QOSPost function add parameter (long) ClientTimestamp
Anton Sotniychuk Need to approving
Anton Sotniychuk
Approved.