Contents:
This API call updates an existing location in the Photomap, e.g. to change details such as category, caption, etc.
The API call is very similar to the photomap.add call. The only difference is that an id, representing the location number, must be specified.
The call updates only the values for the supplied fields. For instance, if the location has a photo already and the update does not supply a new photo, the existing photo will not be removed.
Valid user credentials must be supplied, as with photomap.add.
Example which updates an existing location.
In this example, only the caption and additional metadata are being updated. All other existing data will be unmodified.
POST https://api.cyclestreets.net/v2/photomap.update ( [id] => 64001 [username] => myusername [password] => mypassword1978 [caption] => This location serves the nearby shops. There has recently been an increase in the number of stands. [additionalMetadata] => {"spaces":20,"covered":"no","highway":"Red route"} )
Result:
{ "id": 64001, "url": "https://www.cyclestreets.net/location/64001/", "shortlink": "https://cycle.st/p64001", "imageUrl": "https://www.cyclestreets.net/location/64001/cyclestreets64001.jpg", "thumbnailUrl": "https://www.cyclestreets.net/location/64001/cyclestreets64001-size425.jpg" }
For other parameters, see documentation for photomap.add.
Any of the fields supported by photomap.add (as listed in the required/recommended/optional parameter sections) can be supplied to updated their value(s).
Note that, currently, additionalMetadata must be (re-)supplied as a complete collection if any part of it needs to be updated. We hope to remove this limitation shortly.
There is no support in this API call for updating the username that 'owns' the location. Note that if an update is performed using a privileged (admin) account, the original username of the submitter is maintained.
As shown above, the response is the same as the example in photomap.add.
JSON object containing an error key and a text string.
Example error (text string will vary):
{
"error": "You do not appear to have rights to update this location."
}