Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

I DONT THINK IM GOING TO KEEP USING THIS FUNCTION

/channel/{channel_id}/locations/{location_id}

...

Info

Retrieves Updates a specific channel or all channels available to the user if channel_id is not provided.channels locations

Possible Methods

POST PUT DELETE

Arguments 

...

Arguments

channel_id(optionalrequired)
Channel id to try and return, if not provided returns all channels for current user

Json Object

...

update

location_id (optional)
location id of specific location you want to edit, can be supplied in the message body or url.
Can also be left blank for create or delete (will delete all locations)

Json Object
Code Block
{
    String    "channellocation_id",
: "531733e8b8e08e9d2197b0b0",   String location,
    "events" : [],Double latitude,
    Double longitude,
   "locations" :Double [],
radius,		//in meters
       "name" : "abc123"Date timestamp
}

 

Example
Code Block
curl -b cookies.txt -X GET "http://localhost:8185/channel" > response.txt
curl -b cookies.txt -X GETPOST -d '{"location":"zimbabwe", "latitude":54, "longitude":-7.2, "radius":500}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/531733e8b8e08e9d2197b0b0locations" > response.txt
curl -b cookies.txt -X POSTPUT -d '{"name"location_id":"5345522cb8e034482d1a3520", "location":"abc123california, usa"}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt
curl -b cookies.txt -X PUT -d '{"nameradius":"renamed my channel"50}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations/531733e8b8e08e9d2197b0b05345522cb8e034482d1a3520" > response.txt
curl -b cookies.txt -X PUTDELETE -d '{"channel_idlocation":"531733e8b8e08e9d2197b0b0", "name":"renamed my channel5345522cb8e034482d1a3520"}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt
curl -b cookies.txt -X DELETE -d '{"channel":"531733e8b8e08e9d2197b0b0"}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt

 

Example Response
Info
curl -b cookies.txt -X DELETE POST -d '{"location":"zimbabwe", "latitude":54, "longitude":-7.2, "radius":500}'  "http://localhost:8185/channel/531733e8b8e08e9d2197b0b0531f3e50b8e0a93944925594/locations" > response.txt

 

...

Example Response
 TODO: UPDATE
 

Info
Code Block
Code Block
 {
    "response": {
        "action": "Channel/Locations",
        "success": true,
        "message": "Created a new channel location",
        "time": 0
    },
    "data": {
        "channel_id": "531f3e50b8e0a93944925594",
        "name": "caleb test",
        "locations": [
            {
                "location_id": "5345522cb8e034482d1a3520",
                "location": "zimbabwe",
                "latitude": 54,
                "longitude": -7.2,
                "radius": 500,
                "timestamp": "Apr 9, 2014 01:59:02 PM UTC"
            }
        ],
        "events": [
            {
                "event_id": "52e2e837e4b013563c3ea23e",
                "liked": true,
                "timestamp": "Mar 27, 2014 12:24:39 PM UTC"
            }
        ]
    }
}