Skip to content

Instantly share code, notes, and snippets.

/Geoloqi Secret

Created August 9, 2013 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ea7504379431dac8cd05 to your computer and use it in GitHub Desktop.
Save anonymous/ea7504379431dac8cd05 to your computer and use it in GitHub Desktop.
Geoloqi interaction
The first stuff is output from Java
1 * Client out-bound request
1 > POST https://api.geoloqi.com/1/layer/create
1 > Accept: application/json
1 > Content-Type: application/json
1 > Authorization: OAuth 135d8d-1e8450771414a7fdbd437ee56ae5710a6b96f109
{"name":"A layer","description":"A description","is_app":"0","public":"1"}
1 * Client in-bound response
1 < 201
1 < Date: Fri, 09 Aug 2013 03:56:35 GMT
1 < Content-Length: 19
1 < Connection: keep-alive
1 < X-Request-Duration: 55
1 < Content-Type: application/json
1 < Server: geoloqi-platform
1 < Cache-Control: no-store
1 <
{"layer_id":"9u8U"}
2 * Client out-bound request
2 > POST https://api.geoloqi.com/1/place/create
2 > Accept: application/json
2 > Content-Type: application/json
2 > Authorization: OAuth 135d8d-1e8450771414a7fdbd437ee56ae5710a6b96f109
{"layer_id":"9u8U","name":"A name","latitude":"45.313","longitude":"-122.234","radius":"500","span_longitude":"0.50"}
2 * Client in-bound response
2 < 200
2 < Vary: Accept-Encoding
2 < Date: Fri, 09 Aug 2013 03:56:35 GMT
2 < Content-Length: 223
2 < Connection: keep-alive
2 < X-Request-Duration: 48
2 < Content-Type: application/json
2 < Server: geoloqi-platform
2 < Cache-Control: no-store
2 <
{"place_id":"D_U_","name":"A name","latitude":45.313,"longitude":-122.234,"radius":78282.625,"map":"http:\/\/map.geoloqi.com\/45.313,-122.234?radius=78282.625","display_name":"A name","active":1,"extra":{},"description":""}
3 * Client out-bound request
3 > POST https://api.geoloqi.com/1/trigger/create
3 > Accept: application/json
3 > Content-Type: application/json
3 > Authorization: OAuth 135d8d-1e8450771414a7fdbd437ee56ae5710a6b96f109
{"layer_id":"9u8U","type":"callback","url":"http://beamer.api.dev.beamwallet.com/v1/public/geoloqi-trigger-callback","trigger_on":"enter","one_time":"0","trigger_after":"0"}
3 * Client in-bound response
3 < 200
3 < Vary: Accept-Encoding
3 < Date: Fri, 09 Aug 2013 03:56:36 GMT
3 < Content-Length: 718
3 < Connection: keep-alive
3 < X-Request-Duration: 49
3 < Content-Type: application/json
3 < Server: geoloqi-platform
3 < Cache-Control: no-store
3 <
{"trigger_id":"6a6H","layer_id":"9u8U","type":"callback","trigger_on":"enter","trigger_after":0,"one_time":0,"callback_url":"http:\/\/beamer.api.dev.beamwallet.com\/v1\/public\/geoloqi-trigger-callback","extra":{},"layer":{"layer_id":"9u8U","user_id":"5sYD","type":"normal","name":"A layer","description":"A description","icon":"https:\/\/geoloqi.com\/images\/default_layer.png","public":1,"public_userlist":0,"url":"https:\/\/a.geoloqi.com\/layer\/description\/9u8U","trigger_rate_limit":30,"extra":{},"bounds":{"sw":{"latitude":45.313,"longitude":-122.234},"ne":{"latitude":45.313,"longitude":-122.234},"center":{"latitude":45.313,"longitude":-122.234},"radius":0,"map":"http:\/\/map.geoloqi.com\/45.313,-122.234"}}}
4 * Client out-bound request
4 > POST https://api.geoloqi.com/1/user/create_anon
4 > Accept: application/json
4 > Content-Type: application/json
4 > Authorization: OAuth 135d8d-1e8450771414a7fdbd437ee56ae5710a6b96f109
{"client_id":"d96c98d03f2ec2139eca077ce3674cb4","device_id":"e5b21daa-68e7-486a-8ff4-b9975af8f913","mac":"db8ec055-9b18-4ab5-806a-9a0ce1a4661a"}
4 * Client in-bound response
4 < 200
4 < Vary: Accept-Encoding
4 < Date: Fri, 09 Aug 2013 03:56:36 GMT
4 < Content-Length: 227
4 < Connection: keep-alive
4 < X-Request-Duration: 385
4 < Content-Type: application/json
4 < Server: geoloqi-platform
4 < Cache-Control: no-store
4 <
{"display_name":"Anonymous","username":"_Tfn6Z1mATwb9Qr5xM","user_id":"5u0X","is_anonymous":1,"access_token":"13723f-09e9287d9da44ed1fbc77cf51d74ff05feca03ea","scope":null,"password_reset_token":"_o1Fyn1mATwbt3rLk3","extra":{}}
5 * Client out-bound request
5 > POST https://api.geoloqi.com/1/layer/subscribe/9u8U?user_id=5u0X
5 > Accept: application/json
5 > Content-Type: application/json
5 > Authorization: OAuth 135d8d-1e8450771414a7fdbd437ee56ae5710a6b96f109
5 * Client in-bound response
5 < 201
5 < Date: Fri, 09 Aug 2013 03:56:37 GMT
5 < Content-Length: 34
5 < Connection: keep-alive
5 < X-Request-Duration: 338
5 < Content-Type: application/json
5 < Server: geoloqi-platform
5 < Cache-Control: no-store
5 <
{"layer_id":"9u8U","subscribed":1}
Layer id: 9u8U
Place id: D_U_
Trigger id: 6a6H
User id: 5u0X
User access token: 13723f-09e9287d9da44ed1fbc77cf51d74ff05feca03ea
The last is location updates with curl
curl -i -k -X POST https://api.geoloqi.com/1/location/update \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "Authorization: OAuth 13723f-09e9287d9da44ed1fbc77cf51d74ff05feca03ea" \
-d "[{
\"date\": \"2013-08-09T01:50:38-07:00\",
\"location\": {
\"position\": {
\"latitude\": 105.313,
\"longitude\": -182.234,
\"speed\": 1,
\"altitude\": 0,
\"horizontal_accuracy\": 24,
\"vertical_accuracy\": 0
},
\"type\": \"point\"
},
\"raw\": {
\"distance_filter\": 5,
\"tracking_limit\": 2,
\"rate_limit\": 60,
\"battery\": 86
},
\"client\": {
\"name\": \"Geoloqi\",
\"version\": \"0.1\",
\"platform\": \"iPhone OS 4\",
\"hardware\": \"iPhone2,1\"
}
}]"
curl -i -k -X POST https://api.geoloqi.com/1/location/update \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "Authorization: OAuth 13723f-09e9287d9da44ed1fbc77cf51d74ff05feca03ea" \
-d "[{
\"date\": \"2013-08-09T01:50:38-07:00\",
\"location\": {
\"position\": {
\"latitude\": 45.313,
\"longitude\": -122.234,
\"speed\": 1,
\"altitude\": 0,
\"horizontal_accuracy\": 24,
\"vertical_accuracy\": 0
},
\"type\": \"point\"
},
\"raw\": {
\"distance_filter\": 5,
\"tracking_limit\": 2,
\"rate_limit\": 60,
\"battery\": 86
},
\"client\": {
\"name\": \"Geoloqi\",
\"version\": \"0.1\",
\"platform\": \"iPhone OS 4\",
\"hardware\": \"iPhone2,1\"
}
}]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment