Donate using PayPal

CycleStreets API (v2)

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

Like photo

This API call enables a user to 'Like' a Photomap location.

The call requires that the client generates a token which that application creates as unique to the user, e.g. a session token.

Likes do not require a user account. Accordingly, the value for a location should be treated as indicative.

If the client's user has already set a Like for the location, the Like will be removed; i.e. the API call acts as a toggle.

Example

Example which sets (or unsets) a Like for a location.

POST https://api.cyclestreets.net/v2/photomap.like
(
	[id] => 80
	[token] => 5ea10c55a203a436436eaf940b0c5716
	[fingerprint] => b32aa6d841b705cec282458c6a5976ba4e1c6e0454fc5abe6bf1e17c7e525dac
)

Result:

{
    "id": 80,
    "likes": 8,
    "liked": true,
}

A repeat request would then remove the Like, resulting in the following response:

{
    "id": 80,
    "likes": 7,
    "liked": false,
}

Request parameters - required

id int
The location ID.
token string, max 255 characters
A string acting as an anonymous session identifier, which the client application needs to generate, unique to the client application, for the user. This facilitates the unliking functionality.
fingerprint SHA-256 string, 64 characters
SHA-256 hash of a concatenation of the IP address of the ultimate user and their browser user-agent. This enables auditing to take place, but ensures that no personally-identifable data is sent to the API.

Request parameters - optional

None.

Response

JSON object as above, showing the number of likes so far, now including the one being submitted.

No cookie/session is created or issued.

Error response

JSON object containing an error key and a text string.

Example error (text string will vary):

{
    "error": "An error occurred while adding the Like."
}

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

My comments relate to: *






Your comments: *
URL of page: * https://banbury.cyclestreets.net/api/v2/photomap.like/
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.