diff --git a/README.md b/README.md index c4c267b..3900f98 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![OpenGrid](img/branding/OpenGrid_Logo_Horizontal_3Color.png) -[![Build status - Linux](https://img.shields.io/travis/Chicago/opengrid/master.svg?style=flat-square&label=Linux build)](https://travis-ci.org/Chicago/opengrid)[![Build status - Windows](https://img.shields.io/appveyor/ci/tomschenkjr/opengrid/master.svg?style=flat-square&label=Windows build)](https://ci.appveyor.com/project/tomschenkjr/opengrid)[![Node.js dependencies](https://img.shields.io/coveralls/Chicago/opengrid/master.svg?style=flat-square)](https://coveralls.io/github/Chicago/opengrid)[![Node.js](https://img.shields.io/node/v/gh-badges.svg?style=flat-square)](https://david-dm.org/Chicago/opengrid)[![Node.js dependencies](https://img.shields.io/david/Chicago/opengrid.svg?style=flat-square)](https://david-dm.org/Chicago/opengrid) +[![Build status - Linux](https://img.shields.io/travis/Chicago/opengrid/master.svg?style=flat-square&label=Linux build)](https://travis-ci.org/Chicago/opengrid)[![Build status - Windows](https://img.shields.io/appveyor/ci/tomschenkjr/opengrid/master.svg?style=flat-square&label=Windows build)](https://ci.appveyor.com/project/tomschenkjr/opengrid)[![Node.js dependencies](https://img.shields.io/coveralls/Chicago/opengrid/master.svg?style=flat-square)](https://coveralls.io/github/Chicago/opengrid)[![Node.js](https://img.shields.io/node/v/gh-badges.svg?style=flat-square)](https://david-dm.org/Chicago/opengrid)[![Node.js dependencies](https://img.shields.io/david/Chicago/opengrid.svg?style=flat-square)](https://david-dm.org/Chicago/opengrid)[![Node.js devdependencies](https://img.shields.io/david/dev/chicago/opengrid.svg?style=flat-square)](https://david-dm.org/Chicago/opengrid#info=devDependencies&view=table) OpenGrid an open-source, interactive map platform that allows users to explore multiple data sources in an easy-to-use interface. Developed to support situational awareness, incident monitoring and responses, historical data retrieval, and real-time advanced analytics. Users can perform advanced queries to filter data, search within custom boundaries, or based on the users location. Other GIS data, such as weather and Shapefiles can be overlaid on the map with other data. OpenGrid is natively compatible with desktops and mobile devices. diff --git a/docs/OpenGrid API.md b/docs/OpenGrid API.md index e0f5b2f..b100949 100644 --- a/docs/OpenGrid API.md +++ b/docs/OpenGrid API.md @@ -73,6 +73,7 @@ calling /users/token as described in Section 1.1.1.
POST
+Return a JSON Web Tokn (JWT) token after user id and password have been successfully validated.
@@ -91,12 +92,12 @@ The JavaScript Web Token expire after 4 hours. The authentication token needs to
Sample Response
No response is returned but the authentication token, with key X-AUTH-TOKEN, is appended to the response header such as below:
-
+
X-AUTH-TOKEN:
-eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTQzOTMzNjQwNywianRpIjoiYWRtaW4iLCJyb2xlcyI6Im9wZW5ncmlkX2FkbWlucyIsImZuYW1lIjoiT3BlbkdyaWQiLCJsbmFtZSI6IkFkbWluIn0.nShqceUs52ykIxu0RBRp4vZ8zaQqfdZ2haZn8AWMqyq5GJHRQkddoOaaLtKABktr32C0zha1pMJJBrjuYoPHIQ
-
-
+eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTQzOTMzNjQwNywianRpIjoiYWRtaW4iLCJyb2xlcyI6Im9wZW5ncmlkX2FkbWlucyIsImZuYW1lIjoiT3BlbkdyaWQiLCJsbmFtZSI6IkFkbWluIn0.nShqceUs52ykIxu0RBRp4vZ8zaQqfdZ2haZn8AWMqyq5GJHRQkddoOaaLtKABktr32C0zha1pMJJBrjuYoPHIQ +
This token can be parsed using the jwt_decode JavaScript Web Token library (See https://github.com/auth0/jwt-decode) @@ -165,7 +166,21 @@ Return a list of users given a filter
Sample Response
-[{"_: { "$oid" : "55ca20b9c4aac050466bc1a3"} , "userId" : "tester1" , "password" : "password1" , "firstName" : "Tester" , "lastName" : "One" , "groups" : [ "opengrid_users_L1"]}]
+ [
+
+ {"_id: {"$oid" : "55ca20b9c4aac050466bc1a3"},
+
+"userId" : "tester1",
+
+"password" : "password1",
+
+"firstName" : "Tester",
+
+"lastName" : "One",
+
+"groups" : ["opengrid_users_L1"]
+
}
+
]
Sample Request
-{"id":null,"o":{"userId":"test3","password":"testxxx","firstName":"Test","lastName":"Three","groups":[]}}
+ {"id":null,
+
"o":{"userId":"test3",
+
"password":"testxxx",
+
"firstName":"Test",
+
"lastName":"Three",
+
"groups":[]
+
}
+
}
Sample Response
-{"userId":"test3", "password":"testxxx", "firstName":"Test", "lastName":"Three", "groups":[ ],"_id":{"$oid":"55ca52dec4aac050466bc1a9"}}
+ {"userId":"test3",
+
"password":"testxxx",
+
"firstName":"Test",
+
"lastName":"Three",
+
"groups":[ ],
+
"_id":{"$oid":"55ca52dec4aac050466bc1a9"}
+
}
Sample Response
-{"_id" : { "$oid" : "55b63708a3db5f292c533c7b"} , "userId" : "TesterOne" , "password" : "test123" , "firstName" : "ABC Test" , "lastName" : "One Update" , "groups" : [ "opengrid_users_L1"]}
+ {
+
"_id": {"$oid" : "55b63708a3db5f292c533c7b"},
+
"userId" : "TesterOne",
+
"password" : "test123",
+
"firstName" : "ABC Test",
+
"lastName" : "One Update",
+
"groups" : [ "opengrid_users_L1"]
+
}
Request Payload:
-{"id":{"$oid":"55ccaca15fc6c6bf8a807cf2"},"o":{"_id":{"$oid":"55ccaca15fc6c6bf8a807cf2"},"userId":"twitterUser","password":"testxxx","firstName":"Twitter","lastName":"User","groups":["opengrid_users_L1","opengrid_users_L2"]}}
+ {
+
"id":{"$oid":"55ccaca15fc6c6bf8a807cf2"},
+
"o":{"_id":{"$oid":"55ccaca15fc6c6bf8a807cf2"},
+
"userId":"twitterUser",
+
"password":"testxxx",
+
"firstName":"Twitter",
+
"lastName":"User",
+
"groups":["opengrid_users_L1","opengrid_users_L2"]
+
}
+
}
Sample Response
-{"userId":"test3", "password":"testxxx", "firstName":"Test", "lastName":"3", "groups":[ ]}
+ {
+
"userId":"test3",
+
"password":"testxxx",
+
"firstName":"Test",
+
"lastName":"3",
+
"groups":[ ]
+
}
Sample Response
-[{ "_id" : { "$oid" : "55c0c620a3db5f3058630eb3"} , "groupId" : "opengrid_users" , "name" : "OpenGrid Users" , "description" : "Group for all OpenGrid users" , "enabled" : true , "functions" : [ "Quick Search" , "Advanced Search"] , "datasets" : [ "twitter" , "weather"]}]
+ [
+
{
+
"_id" : {"$oid" : "55c0c620a3db5f3058630eb3"},
+
"groupId" : "opengrid_users",
+
"name" : "OpenGrid Users",
+
"description" : "Group for all OpenGrid users", "enabled" : true,
+
"functions" : [ "Quick Search" , "Advanced Search"],
+
"datasets" : [ "twitter" , "weather"]
+
}
+
]
Sample Response
-{"groupId" : "OPENGRID_NEWGROUP" , "name" : "ABC GROUP" , "description" : "ADD ABC GROUP" , "enabled" : true , "functions" : [ ] , "datasets" : [ ] , "_id" : { "$oid" : "55cb6362c4aa475d78d4bc40"}}
+ {
+
"groupId" : "OPENGRID_NEWGROUP",
+
"name" : "ABC GROUP",
+
"description" : "ADD ABC GROUP",
+
"enabled" : true,
+
"functions" : [ ],
+
"datasets" : [ ] ,
+
"_id" : { "$oid" : "55cb6362c4aa475d78d4bc40"}
+
}
Sample Response
-[{"_id" : { "$oid" : "55c0c620a3db5f3058630eb3"} , "groupId" : "opengrid_users" , "name" : "OpenGrid Users" , "description" : "Group for all OpenGrid users" , "enabled" : true , "functions" : [ "Quick Search" , "Advanced Search"] , "datasets" : [ "twitter" , "weather"]}]
+ [
+
{
+
"_id" : {"$oid" : "55c0c620a3db5f3058630eb3"},
+
"groupId" : "opengrid_users",
+
"name" : "OpenGrid Users",
+
"description" : "Group for all OpenGrid users",
+
"enabled" : true,
+
"functions" : ["Quick Search", "Advanced Search"],
+
"datasets" : ["twitter", "weather"]
+
}
+
]
Request Payload:
-{"id":{"$oid":"55c525c6c4aae748132f4d06"},"o":{"groupId":"opengrid_users_L2","name":"OpenGrid Users Level 2","description":"Users with access to weather data","enabled":true,"isAdmin":false,"functions":["Quick Search","Advanced Search"],"datasets":["weather"]}}}
+ {
+
"id":{"$oid":"55c525c6c4aae748132f4d06"},
+
"o":{"groupId":"opengrid_users_L2",
+
"name":"OpenGrid Users Level 2",
+
"description":"Users with access to weather data",
+
"enabled":true,
+
"isAdmin":false,
+
"functions":["Quick Search","Advanced Search"],
+
"datasets":["weather"]
+
}
+
}
Sample Response
-{"groupId" : "opengrid_users_L2" , "name" : "OpenGrid Users Level 2" , "description" : "Users with access to weather data" , "enabled" : true , "isAdmin" : false , "functions" : [ "Quick Search" , "Advanced Search"] , "datasets" : ["weather"]}
+ {
+
"groupId" : "opengrid_users_L2",
+
"name" : "OpenGrid Users Level 2",
+
"description" : "Users with access to weather data",
+
"enabled" : true,
+
"isAdmin" : false,
+
"functions" : ["Quick Search", "Advanced Search"],
+
"datasets" : ["weather"]
+
}
or when URL encoded:
-
-<Service URL>/groups/%7B%22$oid%22:%2255cb6362c4aa475d78d4bc40%22%7D
+
<Service URL>/groups/%7B%22$oid%22:%2255cb6362c4aa475d78d4bc40%22%7D
Sample Request
-
-<Service URL>/datasets
+
<Service URL>/datasets
Sample Response
-[{ "id" : "twitter" , "displayName" : "Twitter" , "options" : { "rendition" : { "icon" : "default" , "color" : "#001F7A" , "fillColor" : "#00FFFF" , "opacity" : 85 , "size" : 6}} , "columns" : [ { "id" : "_id" , "displayName" : "ID" , "dataType" : "string" , "filter" : false , "popup" : false , "list" : false} , { "id" : "date" , "displayName" : "Date" , "dataType" : "date" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 1} , { "id" : "screenName" , "displayName" : "Screen Name" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 2 , "groupBy" : true} , { "id" : "text" , "displayName" : "Text" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 3} , { "id" : "city" , "displayName" : "City" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 4 , "groupBy" : true} , { "id" : "bio" , "displayName" : "Bio" , "dataType" : "string" , "sortOrder" : 5} , { "id" : "hashtags" , "displayName" : "Hashtags" , "dataType" : "string" , "sortOrder" : 6} , { "id" : "lat" , "displayName" : "Latitude" , "dataType" : "float" , "list" : true , "sortOrder" : 7} , { "id" : "long" , "displayName" : "Longitude" , "dataType" : "float" , "list" : true , "sortOrder" : 8}]}, { "id" : "weather" , "displayName" : "Weather" , "options" : { "rendition" : { "icon" : "default" , "color" : "#8c2d04" , "fillColor" : "#fdae6b" , "opacity" : 85 , "size" : 6}} , "columns" : [ { "id" : "_id" , "displayName" : "ID" , "dataType" : "string" , "filter" : false , "popup" : false , "list" : false} , { "id" : "temp" , "displayName" : "Temperature" , "dataType" : "float" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 1} , { "id" : "windspeed" , "displayName" : "Wind Speed" , "dataType" : "float" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 2} , { "id" : "condition" , "displayName" : "Condition" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 3} , { "id" : "humidity" , "displayName" : "Humidity" , "dataType" : "float" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 4} , { "id" : "precipIntensity" , "displayName" : "Precipitation Intensity" , "dataType" : "float" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 5} , { "id" : "date" , "displayName" : "Date" , "dataType" : "date" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 5} , { "id" : "zipcode" , "displayName" : "Zip Code" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 6 , "values" : [ 60601 , 60602] , "groupBy" : true} , { "id" : "forecast" ,"displayName" : "Today's Forecast" , "dataType" : "string" , "popup" : true , "list" : true , "sortOrder" : 7} , { "id" : "icon" , "displayName" : "Icon" , "dataType" : "graphic" , "popup" : true , "sortOrder" : 7} , { "id" : "lat" , "displayName" : "Latitude" , "dataType" : "float" , "list" : true , "sortOrder" : 8} , { "id" : "long" , "displayName" : "Longitude" , "dataType" : "float" , "list" : true , "sortOrder" : 9}]}]
+ [
+
{ "id" : "twitter",
+
"displayName" : "Twitter",
+
"options" : {"rendition" :{
+
"icon" : "default",
+
"color" : "#001F7A", "fillColor" : "#00FFFF",
+
"opacity" : 85,
+
"size" : 6 }
+
}, "columns":
+
[{ "id" : "_id",
+
"displayName" : "ID",
+
"dataType" : "string",
+
"filter" : false,
+
"popup" : false,
+
"list" : false },
+
{"id" : "date",
+
"displayName" : "Date",
+
"dataType" : "date", "filter" : true,
+
"popup" : true, "list" : true,
+
"sortOrder" : 1},
+
{"id": "screenName",
+
"displayName" : "Screen Name",
+
"dataType" : "string", "filter" : true,
+
"popup" : true, "list" : true, "sortOrder" : 2,
+
"groupBy" : true },
+
{"id" : "text",
+
"displayName" : "Text",
+
"dataType" : "string",
+
"filter" : true,
+
"popup" : true, "list" : true,
+
"sortOrder": 3},
+
{"id" : "city",
+
"displayName" : "City",
+
"dataType" : "string",
+
"filter" : true,
+
"popup" : true, "list" : true,
+
"sortOrder" : 4,
+
"groupBy" : true},
+
{"id" :"bio",
+
"displayName" : "Bio",
+
"dataType" : "string",
+
"sortOrder" : 5},
+
{"id" : "hashtags",
+
"displayName" : "Hashtags",
+
"dataType" : "string",
+
"sortOrder" : 6},
+
{"id" : "lat",
+
"displayName" : "Latitude",
+
"dataType" : "float",
+
"list" : true,
+
"sortOrder" : 7},
+
{"id" : "long",
+
"displayName" : "Longitude",
+
"dataType" : "float",
+
"list" : true,
+
"sortOrder" : 8 }
+
] },
+
{"id" : "weather",
+
"displayName" : "Weather",
+
"options" :
+
{ "rendition" :
+
{
+
"icon" : "default",
+
"color" : "#8c2d04", "fillColor" : "#fdae6b",
+
"opacity" : 85,
+
"size" : 6
+
}
+
}, "columns" :
+
[
+
{"id :" "_id",
+
"displayName" : "ID",
+
"dataType" : "string",
+
"filter" : false,
+
"popup" : false,
+
"list" : false
+
},
+
{"id" : "temp",
+
"displayName" : "Temperature",
+
"dataType" : "float",
+
"filter" : true,
+
"popup" : true, "list" : true,
+
"sortOrder" : 1
+
},
+
{"id" : "windspeed",
+
"displayName" : "Wind Speed",
+
"dataType" : "float",
+
"filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 2
+
},
+
{"id" : "condition",
+
"displayName" : "Condition",
+
"dataType" : "string",
+
"filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 3
+
},
+
{"id" : "humidity",
+
"displayName" : "Humidity",
+
"dataType" : "float",
+
"filter" : true,
+
"popup" : true,
+
"list" : true, "sortOrder" : 4
+
},
+
{"id" : "precipIntensity",
+
"displayName" : "Precipitation Intensity",
+
"dataType" : "float",
+
"filter" : true, "popup" : true,
+
"list" : true , "sortOrder" : 5
+
},
+
{"id" : "date",
+
"displayName" : "Date",
+
"dataType" : "date",
+
"filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 5
+
},
+
{"id" : "zipcode",
+
"displayName" : "Zip Code",
+
"dataType" : "string",
+
"filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 6 ,
+
"values" : [ 60601 , 60602], "groupBy" : true
+
},
+
{"id" :"forecast",
+
"displayName" : "Today's Forecast",
+
"dataType" : "string",
+
"popup" : true, "list" : true , "sortOrder" : 7
+
},
+
{"id" : "icon",
+
"displayName" : "Icon",
+
"dataType" : "graphic",
+
"popup" : true , "sortOrder" : 7
+
},
+
{"id" : "lat",
+
"displayName" : "Latitude",
+
"dataType" : "float",
+
"list" : true , "sortOrder" : 8
+
},
+
{"id" : "long",
+
"displayName" : "Longitude",
+
"dataType" : "float", "list" : true,
+
"sortOrder" : 9
+
}
+
]
+
}
+
]
GET
@@ -441,11 +679,74 @@ Return a single dataset descriptor. An HTTP 403 is returned when the user has no
Sample Response
-{"id" : "twitter" , "displayName" : "Twitter" , "options" : { "rendition" : { "icon" : "default" , "color" : "#001F7A" , "fillColor" : "#00FFFF" , "opacity" : 85 , "size" : 6}} , "columns" : [ { "id" : "_id" , "displayName" : "ID" , "dataType" : "string" , "filter" : false , "popup" : false , "list" : false} , { "id" : "date" , "displayName" : "Date" , "dataType" : "date" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 1} , { "id" : "screenName" , "displayName" : "Screen Name" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 2 , "groupBy" : true} , { "id" : "text" , "displayName" : "Text" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 3} , { "id" : "city" , "displayName" : "City" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 4 , "groupBy" : true} , { "id" : "bio" , "displayName" : "Bio" , "dataType" : "string" , "sortOrder" : 5} , { "id" : "hashtags" , "displayName" : "Hashtags" , "dataType" : "string" , "sortOrder" : 6} , { "id" : "lat" , "displayName" : "Latitude" , "dataType" : "float" , "list" : true , "sortOrder" : 7} , { "id" : "long" , "displayName" : "Longitude" , "dataType" : "float" , "list" : true , "sortOrder" : 8}]}
+
{
+
"id" : "twitter",
+
"displayName" : "Twitter", "options" :
+
{ "rendition" :
+
{ "icon" : "default",
+
"color" : "#001F7A", "fillColor" : "#00FFFF",
+
"opacity" : 85, "size" : 6
+
}
+
},
+
"columns" : [ {"id" : "_id",
+
"displayName" : "ID",
+
"dataType" : "string",
+
"filter" : false, "popup" : false,
+
"list" : false
+
},
+
{"id" : "date",
+
"displayName" : "Date",
+
"dataType" : "date",
+
"filter" : true, "popup" : true,
+
"list" : true , "sortOrder": 1
+
},
+
{"id" : "screenName",
+
"displayName" : "Screen Name",
+
"dataType" : "string",
+
"filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 2,
+
"groupBy" : true
+
},
+
{"id" : "text",
+
"displayName" : "Text",
+
"dataType" : "string",
+
"filter" : true,
+
"popup" : true, "list" : true,
+
"sortOrder" : 3
+
},
+
{"id" : "city",
+
"displayName" : "City",
+
"dataType" : "string",
+
"filter" : true, "popup" : true,
+
"list" : true , "sortOrder" : 4,
+
"groupBy" : true
+
},
+
{"id" : "bio",
+
"displayName" : "Bio",
+
"dataType" : "string", "sortOrder" : 5
+
},
+
{"id" : "hashtags",
+
"displayName" : "Hashtags",
+
"dataType" : "string",
+
"sortOrder" : 6
+
},
+
{"id" : "lat",
+
"displayName" : "Latitude",
+
"dataType" : "float",
+
"list" : true , "sortOrder" : 7
+
},
+
{"id" : "long",
+
"displayName" : "Longitude",
+
"dataType" : "float", "list" : true,
+
"sortOrder" : 8
+
}
+
]
+
}
GET
@@ -501,7 +802,44 @@ It is recommended that this value be URL encoded.
Sample Response
-{"type" : "FeatureCollection", "features" : [{"type": "Feature", "properties": { "_id" : { "$oid" : "556e6f18aef407e1dc98685e"} , "date" : "05/02/2012 8:24 AM" , "screenName" : "DeeeEmmm" , "text" : "Just talked to bleep last nyt.... Felt happy, but sad in a lot of ways...." , "city" : "Chicago, IL" , "bio" : "I'm the female version of Ari Gold!" , "lat" : 41.84770456 , "long" : -87.8521837 , "hashtags" : ""}, "geometry": {"type": "Point", "coordinates": [-87.8521837,41.84770456]}, "autoPopup": false }],"meta": { "view": { "id" : "twitter" , "displayName" : "Twitter" , "options" : { "rendition" : { "icon" : "default" , "color" : "#001F7A" , "fillColor" : "#00FFFF" , "opacity" : 85 , "size" : 6}} , "columns" : [ { "id" : "_id" , "displayName" : "ID" , "dataType" : "string" , "filter" : false , "popup" : false , "list" : false} , { "id" : "date" , "displayName" : "Date" , "dataType" : "date" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 1} , { "id" : "screenName" , "displayName" : "Screen Name" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 2 , "groupBy" : true} , { "id" : "text" , "displayName" : "Text" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 3} , { "id" : "city" , "displayName" : "City" , "dataType" : "string" , "filter" : true , "popup" : true , "list" : true , "sortOrder" : 4 , "groupBy" : true} , { "id" : "bio" , "displayName" : "Bio" , "dataType" : "string" , "sortOrder" : 5} , { "id" : "hashtags" , "displayName" : "Hashtags" , "dataType" : "string" , "sortOrder" : 6} , { "id" : "lat" , "displayName" : "Latitude" , "dataType" : "float" , "list" : true , "sortOrder" : 7} , { "id" : "long" , "displayName" : "Longitude" , "dataType" : "float" , "list" : true , "sortOrder" : 8}]} }}
+ {
+
"type" : "FeatureCollection",
+
"features" : [
+
{
+
"type": "Feature",
+
"properties":
+
{ "_id" : {"$oid" : "556e6f18aef407e1dc98685e"},
+
"date" : "05/02/2012 8:24 AM",
+
"screenName" : "DeeeEmmm",
+
"text" : "Just talked to bleep last nyt.... Felt happy, but sad in a lot of ways....",
+
"city" : "Chicago, IL", "bio" : "I'm the female version of Ari Gold!",
+
"lat" : 41.84770456 , "long" : -87.8521837,
+
"hashtags" : ""},
+
"geometry": {"type": "Point",
+
"coordinates": [-87.8521837,41.84770456]},
+
"autoPopup": false }],
+
"meta": { "view": { "id" : "twitter",
+
"displayName" : "Twitter", "options" : {"rendition" :
+
{"icon" : "default", "color" : "#001F7A", "fillColor" : "#00FFFF", "opacity" : 85 , "size" : 6}},
+
"columns" : [ {"id" : "_id",
+
"displayName" : "ID", "dataType" : "string", "filter" : false, "popup" : false, "list" : false},
+
{"id" : "date", "displayName" : "Date", "dataType" : "date",
+
"filter" : true, "popup" : true, "list" : true, "sortOrder" : 1},
+
{"id" : "screenName", "displayName" : "Screen Name",
+
"dataType" : "string", "filter" : true, "popup" : true,
+
"list" : true, "sortOrder" : 2, "groupBy" : true},
+
{"id" : "text", "displayName" : "Text", "dataType" : "string",
+
"filter" : true, "popup" : true, "list" : true, "sortOrder" : 3},
+
{"id" : "city", "displayName" : "City", "dataType" : "string",
+
"filter" : true, "popup" : true, "list" : true, "sortOrder" : 4, "groupBy" : true},
+
{"id" : "bio", "displayName" : "Bio", "dataType" : "string", "sortOrder" : 5},
+
{"id" : "hashtags", "displayName" : "Hashtags", "dataType" : "string", "sortOrder" : 6},
+
{"id" : "lat", "displayName" : "Latitude", "dataType" : "float", "list" : true, "sortOrder" : 7},
+
{"id" : "long", "displayName" : "Longitude", "dataType" : "float", "list" : true , "sortOrder" : 8}
+
]
+
}
+
}
+
}
Sample Response
-[{"_id" : { "$oid" : "5582f831a3db5f4190e4707a"} , "name" : "Weather Records for 60601" , "owner" : "jsmith" , "spec" : [ { "dataSetId" : "weather" , "filters" : { "condition" : "AND" , "rules" : [ { "id" : "zipcode" , "field" : "zipcode" , "type" : "string" , "input" : "text" , "operator" : "equal" , "value" : "60601"}]} , "rendition" : { "color" : "#DC143C" , "opacity" : 85 , "size" : 6}}] , "sharedWith" : { "users" : [ ] , "groups" : [ ]} , "isCommon" : true}]
+ [
+
{"_id" :
+
{"$oid" : "5582f831a3db5f4190e4707a"},
+
"name" : "Weather Records for 60601", "owner" : "jsmith", "spec" :
+
[
+
{"dataSetId" : "weather", "filters" : {"condition" : "AND", "rules" :
+
[ {"id" : "zipcode", "field" : "zipcode", "type" : "string",
+
"input" : "text", "operator" : "equal", "value" : "60601"}
+
]
+
},
+
"rendition" : {"color" : "#DC143C", "opacity" : 85, "size" : 6}
+
}
+
],
+
"sharedWith" : { "users" : [ ], "groups" : [ ]},
+
"isCommon" : true}
+
]
-{"o":{"name":"Tweets By Bud","owner":"user1","spec":[{"dataSetId":"twitter","filters":{"condition":"AND","rules":[{"id":"screenName","field":"screenName","type":"string","input":"text","operator":"contains","value":"bud"}]},"rendition":{"color":"#DC143C","opacity":"85","size":"6"}}],"sharedWith":{"users":[],"groups":[]},"isCommon":false,"autoRefresh":false,"refreshInterval":"30","geoFilter":{"boundaryType":"within","boundary":""}}}
+ {
+
"o":{
+
"name":"Tweets By Bud",
+
"owner":"user1","spec":
+
[
+
{
+
"dataSetId":"twitter",
+
"filters":{
+
"condition":"AND","rules":[{
+
"id":"screenName",
+
"field":"screenName",
+
"type":"string","input":"text",
+
"operator":"contains","value":"bud"}]
+
},"rendition":{
+
"color":"#DC143C","opacity":"85","size":"6"}
+
}
+
],
+
"sharedWith":{
+
"users":[],
+
"groups":[]
+
},"isCommon":false,
+
"autoRefresh":false,"refreshInterval":"30",
+
"geoFilter":{"boundaryType":"within","boundary":""}
+
}
+
}
Sample Response
-{"name" : "Tweets By Bud" , "owner" : "user1" , "spec" : [ { "dataSetId" : "twitter" , "filters" : { "condition" : "AND" , "rules" : [ { "id" : "screenName" , "field" : "screenName" , "type" : "string" , "input" : "text" , "operator" : "contains" , "value" : "bud"}]} , "rendition" : { "color" : "#DC143C" , "opacity" : "85" , "size" : "6"}}] , "sharedWith" : { "users" : [ ] , "groups" : [ ]} , "isCommon" : false , "autoRefresh" : false , "refreshInterval" : "30" , "geoFilter" : { "boundaryType" : "within" , "boundary" : ""} , "_id" : { "$oid" : "55df5ec39900ec81a481b0f6"}}
+ {
+
"name" : "Tweets By Bud",
+
"owner" : "user1",
+
"spec" : [ {
+
"dataSetId" : "twitter",
+
"filters" : {
+
"condition" : "AND",
+
"rules" : [ {
+
"id" : "screenName",
+
"field" : "screenName",
+
"type" : "string",
+
"input" : "text",
+
"operator" : "contains" , "value" : "bud"}]
+
},
+
"rendition" : {"color" : "#DC143C",
+
"opacity" : "85", "size" : "6"
+
}
+
}],
+
"sharedWith" : {
+
"users" : [ ],
+
"groups" : [ ] },
+
"isCommon" : false,
+
"autoRefresh" : false, "refreshInterval" : "30",
+
"geoFilter" : { "boundaryType" : "within" , "boundary" : ""},
+
"_id" : { "$oid" : "55df5ec39900ec81a481b0f6"}
+
}
GET
@@ -606,7 +1009,20 @@ Return a single query given a query’s internal id.
Sample Response
-[{"_id" : { "$oid" : "5582f831a3db5f4190e4707a"} , "name" : "Weather Records for 60601" , "owner" : "jsmith" , "spec" : [ { "dataSetId" : "weather" , "filters" : { "condition" : "AND" , "rules" : [ { "id" : "zipcode" , "field" : "zipcode" , "type" : "string" , "input" : "text" , "operator" : "equal" , "value" : "60601"}]} , "rendition" : { "color" : "#DC143C" , "opacity" : 85 , "size" : 6}}] , "sharedWith" : { "users" : [ ] , "groups" : [ ]} , "isCommon" : true}]
+[
+
{"_id" :
+
{ "$oid" : "5582f831a3db5f4190e4707a"},
+
"name" : "Weather Records for 60601",
+
"owner" : "jsmith", "spec" : [ { "dataSetId" : "weather",
+
"filters" : { "condition" : "AND" , "rules" :
+
[{ "id" : "zipcode" , "field" : "zipcode",
+
"type" : "string", "input" : "text",
+
"operator" : "equal", "value" : "60601"
+
}]
+
}, "rendition" : { "color" : "#DC143C", "opacity" : 85, "size" : 6}
+
}], "sharedWith" : { "users" : [ ], "groups" : [ ]},
+
"isCommon" : true}
+
]
or when URL encoded:
+
or when URL encoded:
<Service URL>/queries/%7B%22$oid%22:%2255c52cf6c4aa31b24b04d620%22%7D
@@ -629,7 +1045,38 @@ Update a query. Returns the updated query object, if successful.
Sample Response
-{"name" : "Tweets on coupon" , "owner" : "user1" , "spec" : [ { "dataSetId" : "twitter" , "filters" : { "condition" : "AND" , "rules" : [ { "id" : "text" , "field" : "text" , "type" : "string" , "input" : "text" , "operator" : "contains" , "value" : "coupon"}]} , "rendition" : { "color" : "#DC143C" , "opacity" : "85" , "size" : "6"}}] , "sharedWith" : { "users" : [ ] , "groups" : [ ]} , "isCommon" : false , "autoRefresh" : false , "refreshInterval" : "30" , "_id" : { "$oid" : "55c52cf6c4aa31b24b04d620"} , "geoFilter" : { "boundaryType" : "within" , "boundary" : ""}}
+ {
+
"name" : "Tweets on coupon",
+
"owner" : "user1",
+
"spec" : [ {
+
"dataSetId" : "twitter",
+
"filters" : {
+
"condition" : "AND",
+
"rules" : [ {
+
"id" : "text",
+
"field" : "text",
+
"type" : "string",
+
"input" : "text",
+
"operator" : "contains",
+
"value" : "coupon"}]
+
},
+
"rendition" : {
+
"color" : "#DC143C",
+
"opacity" : "85",
+
"size" : "6"}
+
}],
+
"sharedWith" : { "users" : [ ],
+
"groups" : [ ]
+
},
+
"isCommon" : false,
+
"autoRefresh" : false,
+
"refreshInterval" : "30",
+
"_id" : {
+
"$oid" : "55c52cf6c4aa31b24b04d620"},
+
"geoFilter" : {
+
"boundaryType" : "within",
+
"boundary" : ""}
+
}
Sample Request
-URL:
-
<Service URL>/queries/{"$oid":"55cb6362c4aa475d78d4bc40"}
@@ -659,37 +1104,38 @@ No response is returned when a query is deleted.
## 1.2 HTTP Status Codes on Response
-
-{
- “error”: {
+
{
+ “error”: {
+
+ “code”: “<error code>”
+
+ “message”: “<error message>”
- “code”: “<error code>”
+
}
+
+ }
-“message”: “<error message>”
-}
-}
where <error code> is a code corresponding to the error that occurred and <error message> is a description of the error.
-