Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

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

Updates a channels locations

Possible Methods

POST PUT DELETE

Arguments

channel_id(required)
Channel id to try and update

location_id (optional)
location id of specific location you want to edit, can be supplied in the message body or left blank for create

Json Object
{
    String location_id,
    String location,
    Double latitude,
    Double longitude,
    Double radius,		//in meters
    Date timestamp
}

 

Example
curl -b cookies.txt -X POST -d '{"location":"zimbabwe", "latitude":54, "longitude":-7.2, "radius":500}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt
curl -b cookies.txt -X PUT -d '{"location_id":"5345522cb8e034482d1a3520", "location":"california, usa"}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt
curl -b cookies.txt -X PUT -d '{"radius":50}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations/5345522cb8e034482d1a3520" > response.txt
curl -b cookies.txt -X DELETE -d '{"location":"5345522cb8e034482d1a3520"}'  "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt
curl -b cookies.txt -X DELETE "http://localhost:8185/channel/531f3e50b8e0a93944925594/locations" > response.txt

 

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

 

 {
    "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"
            }
        ]
    }
}
  • No labels