User Tools

Site Tools


version_1:get_model

Requesting context models

For requesting a certain context model of a person, this interface can be used. It can be specified, if the complete model, a time-limited model or the latest model is sent back. There are also some possibilities to filter the resulting events.

Authentication required

Yes, please take a look at Authentication. To keep it simple, only the data parameter is mentioned on this page, but keep in mind that the other parameters are also necessary.

Response

JSON

Method

GET

Resource URL

Parameters

The sent JSON object data should contain the following parameters:

model

A model can either be COMPLETE (resulting in all the available context information of a user), LATEST (only the latest context information of a user) or SPECIFIC (the context information of a certain time period).

start

An optional value, but required for the model SPECIFIC. This is a UNIX timestamp the beginning of the time period.

end

An optional value, but required for the model SPECIFIC. This is a UNIX timestamp the end of the time period.

category

A filter that only those events of a certain category are returned.

source

A filter that only those events of a certain source are returned.

type

A filter that only those events of a certain type are returned.

Example

Request

data={
	"model":"SPECIFIC",
	"start":1367493643,
	"end":1367494024,
	"category":"ENVIRONMENT",
	"source":"MOBILE",
	"type":"POSITION"
}

Response

{
   "APIVersion":1,
   "events":[
      {
         "id":"430",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367494024",
         "items":[
            {
               "title":"lat",
               "value":"50.7777497"
            },
            {
               "title":"lng",
               "value":"6.0612095"
            }
         ]
      },
      {
         "id":"429",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493947",
         "items":[
            {
               "title":"lat",
               "value":"50.7787374"
            },
            {
               "title":"lng",
               "value":"6.0590381"
            }
         ]
      },
      {
         "id":"428",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493883",
         "items":[
            {
               "title":"lat",
               "value":"50.7786859"
            },
            {
               "title":"lng",
               "value":"6.0578903"
            }
         ]
      },
      {
         "id":"427",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493823",
         "items":[
            {
               "title":"lat",
               "value":"50.7787717"
            },
            {
               "title":"lng",
               "value":"6.0571058"
            }
         ]
      },
      {
         "id":"426",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493763",
         "items":[
            {
               "title":"lng",
               "value":"6.0560441"
            },
            {
               "title":"lat",
               "value":"50.7789188"
            }
         ]
      },
      {
         "id":"425",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493703",
         "items":[
            {
               "title":"lat",
               "value":"50.7792587"
            },
            {
               "title":"lng",
               "value":"6.054866"
            }
         ]
      },
      {
         "id":"424",
         "app":"de.thues.bigbrother",
         "source":"MOBILE",
         "action":"START",
         "type":"POSITION",
         "category":"ENVIRONMENT",
         "timestamp":"1367493643",
         "items":[
            {
               "title":"lat",
               "value":"50.7793209"
            },
            {
               "title":"lng",
               "value":"6.0544413"
            }
         ]
      }
   ]
}

version_1/get_model.txt · Last modified: 01.05.2016 21:36 (external edit)