Donate using PayPal

CycleStreets API (v2)

  • Details for:
  • API overview
  • Obtain API key
  • Usage policy
  • Uptime policy

Create a gallery

This API call is used to add a Photo Gallery. Each Gallery has a collection of photos attached.

The Gallery is an ideal campaigning tool to enable citizens to visually document problems such as lack of cycle parking, or to highlight good practice, so that this data can be used by cycle campaign groups, Local Authorities and others.

Example

Example which adds a Gallery representing a cycle parking problem, including a photos of the situation, and supplying some additional information in the description.

This call requires a POST operation.

POST https://api.cyclestreets.net/v2/galleries.add/
(	
	[username] => myusername
	[password] => mypassword1992
	[title] => Cycleparking problem in King's Cross Station
	[description] => 4 welcome new racks, for 8 bikes, have been installed at the station. Yet, many more are needed.
	[photos] => 301-303,401
)

Result:

{
    "id": 320,
    "url": "https://www.cyclestreets.net/galleries/320/"
}

You could later retrieve the data via a request to galleries.show as follows:

https://api.cyclestreets.net/v2/galleries.show?id=300

Request parameters - required

The following are required parameters.

username string
The username of a user (whose account has been through validation). The API call will use the username/password credentials to perform authentication. If you are creating a third-party auditing-style application, it is fine to register a single user account and all submissions be made as that user.
password string
The password for this user. See details for username.
title string
Text for a title describing the Gallery.
description string
Text for a description of the Gallery.
photos string
List of location IDs. This list will be parsed and can be formed of single numbers separated by commas (1,4,6), or a hyphen, which will provide a range of photos (eg. 5-10 will provide photos 5 to 10).

Request parameters - optional

None.

Response

JSON object as above, showing the unique ID and URL of the added Gallery.

You may wish to use these to show the successfully uploaded Gallery to the user by way of a confirmation screen, and/or invite the user to share the link on social media.

Error response

JSON object containing an error key and a text string.

The error string from this method is suitable for passing directly on to the user.

Example error (text string may vary):

{
    "error": "A username and password must both be supplied."
}

We welcome your feedback, especially to report bugs or give us route feedback.

My comments relate to: *






Your comments: *
URL of page: * http://www.cyclestreets.dk/api/v2/galleries.add/
How did you find out about CycleStreets?:
Your name:
Our ref: Please leave blank - anti-spam measure

* Items marked with an asterisk [*] are required fields and must be fully completed.