-
Notifications
You must be signed in to change notification settings - Fork 2
Don Park edited this page Aug 5, 2019
·
1 revision
---> request
{
"id": "<uuid>",
"method": "<object.verb>",
"params": {
"<object attribute>": { "<type>" : { "id":123, "<attr2>":"<value>"} },
"<location>": { "location" : { "id":456, "latitude": 45.5 } }
}
}
<--- respond
{
"id": "<uuid from request>",
"result": {
"result param 1": "value 1"
}
}
<--- receive on error
{
"id": "<uuid from request>",
"error": {
"code": "<code>",
"message": "<human readable message>"
}
}
- wss://api.icecondor.com/v2
Hello is the first message to be sent and received on the stream.
<--- server hello
{
"id" : "<uuid>",
"method": "hello",
"params": {
"name" : "<server name>",
"version": "<software version>",
"session_id": "<session id>"
}
}
---> client hello (not used)
{
"id": "<uuid>",
"method": "hello",
"params": {
"version": "<version id>"
}
}
<--- receive
{
"id": "<uuid>",
"result": {
}
}
Request a session token be sent to the email
---> client request
{
"id": "<uuid>",
"method": "auth.email",
"params" : {
"email": "<email>",
"device_id": "<device id>"
}
}
<--- receive
{
"id": "<uuid>",
"result": {
"status": "sent"
}
}
{
"id": "<uuid>",
"error": {
"code": "<code>",
"message": "Unsuccessful token request."
}
}
Token
icecondor://android/v2/auth?access_token=<token>
Picked up by AndroidManifest
<data android:scheme="icecondor" />
The api stream starts out as unauthenticated. Some commands do not need authentication. The device key is the base64(sha256.hex(access_token+device_id))
---> client request
{
"id": "<uuid>",
"method": "auth.session",
"params" : {
"device_key": "<device key>",
}
}
<--- receive
{
"id": "<uuid>",
"result": {
}
}
{
"txid": "<uuid>",
"error": {
"code": "<code>",
"message": "Unsuccessful authentication."
}
}
A location message can come from the client to record a new position. It can also come from the server to the client to report a historical position. ---> send
{
"id": "<uuid>",
"method": "location.create",
"params": {
"position" : {
"latitude" : 45.5,
"longitude" : -122.5,
},
"provider": "gps"
}
}
<--- receive
{
"txid": "<uuid>",
"result": {
"ok": true
}
}
{
"txid": "<uuid>",
"error": {
"code": "<code>",
"message": "<human readable message>"
}
}
{ "id": "<txid>",
"method": "device.create",
"params": {
"device_id": "<device_id>",
"client" : {
"name" : "icecondor",
"version" : "20111010",
},
"platform" : {
"name" : "android",
"version" : "2.3"
},
"hardware": {
"make": "LG",
"model": "ab-201"
}
}
The client sends a filter message to begin a stream of Nouns from the server (such as location).
{ "type": "stream",
"noun": "location"
"filters": [ <filter elements> ]
}
{ "type":"user", "username": "donpdonp"}
{ "type":"boundingbox", "geometry" :
{"type": "Polygon", "coordinates": []} }
{ "type": "status",
}