Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions docs/dev/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ sidebar_position: 3

# PastVu API

:::warning Deprecated
The API endpoint `https://pastvu.com/api2` has been deprecated in favor of `https://api.pastvu.com/api2`. Please update your integrations to use the new endpoint.
:::

:::info
To retrieve a photo, you need to add the contents of the `file` field from the API method response to the URL:
* `https://img.pastvu.com/d/` for standard size;
* `https://img.pastvu.com/a/` for original size;
* `https://img.pastvu.com/h/` for thumbnail size.
:::

:::warning Deprecated
* `https://pastvu.com/_p/d/` for standard size;
* `https://pastvu.com/_p/a/` for original size;
* `https://pastvu.com/_p/h/` for thumbnail size.
Expand All @@ -28,7 +38,7 @@ cid | ✓ | int | unique photo number |

**Query example:**

`https://pastvu.com/api2?method=photo.giveForPage&params={"cid":5}`
`https://api.pastvu.com/api2?method=photo.giveForPage&params={"cid":5}`

### comment.giveForObj

Expand All @@ -40,7 +50,7 @@ cid | ✓ | int | unique photo number |

**Query example:**

`https://pastvu.com/api2?method=comment.giveForObj&params={"cid":23314}`
`https://api.pastvu.com/api2?method=comment.giveForObj&params={"cid":23314}`

### photo.giveNearestPhotos
Returns an array of photos closest to the passed coordinate. The array is sorted in ascending distance order.
Expand All @@ -58,7 +68,7 @@ skip | int | | skip the specified number of photos from the beginning of the sea

**Query example:**

`https://pastvu.com/api2?method=photo.giveNearestPhotos&params={"geo":[37.82,-122.469322],"limit":12,"except":228481}`
`https://api.pastvu.com/api2?method=photo.giveNearestPhotos&params={"geo":[37.82,-122.469322],"limit":12,"except":228481}`

### photo.getByBounds

Expand All @@ -75,5 +85,5 @@ localWork | | bool | 0 | return array of `photos` (set 1 when using zoom value >

**Query example:**

`https://pastvu.com/api2?method=photo.getByBounds&params={"z":11,"geometry":{"type":"Polygon","coordinates":[[[37.29034423828125,55.56902805913944],[37. 95501708984375,55.56902805913944],[37.95501708984375,55.92150795277898],[37.29034423828125,55.92150795277898],[37.29034423828125,55.56902805913944]]]}}`
`https://api.pastvu.com/api2?method=photo.getByBounds&params={"z":11,"geometry":{"type":"Polygon","coordinates":[[[37.29034423828125,55.56902805913944],[37. 95501708984375,55.56902805913944],[37.95501708984375,55.92150795277898],[37.29034423828125,55.92150795277898],[37.29034423828125,55.56902805913944]]]}}`

18 changes: 14 additions & 4 deletions i18n/ru/docusaurus-plugin-content-docs/current/dev/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ sidebar_position: 3

# PastVu API

:::warning Устаревший адрес
API `https://pastvu.com/api2` устарел. Пожалуйста, обновите ваши интеграции для использования нового адреса `https://api.pastvu.com/api2`.
:::

:::info
Для получения фото, необходимо к URL добавить содержимое поля `file` из ответа API метода:
* `https://img.pastvu.com/d/` для стандартного размера;
* `https://img.pastvu.com/a/` для оригинального размера;
* `https://img.pastvu.com/h/` для миниатюры.
:::

:::warning Устаревшие адреса
* `https://pastvu.com/_p/d/` для стандартного размера;
* `https://pastvu.com/_p/a/` для оригинального размера;
* `https://pastvu.com/_p/h/` для миниатюры.
Expand All @@ -28,7 +38,7 @@ cid | ✓ | int | уникальный номер снимка |

**Пример запроса:**

`https://pastvu.com/api2?method=photo.giveForPage&params={"cid":5}`
`https://api.pastvu.com/api2?method=photo.giveForPage&params={"cid":5}`

### comment.giveForObj

Expand All @@ -40,7 +50,7 @@ cid | ✓ | int | уникальный номер снимка |

**Пример запроса:**

`https://pastvu.com/api2?method=comment.giveForObj&params={"cid":23314}`
`https://api.pastvu.com/api2?method=comment.giveForObj&params={"cid":23314}`

### photo.giveNearestPhotos
Возвращает массив фотографий, ближайших переданной координате. Массив отсортирован по возрастанию расстояния.
Expand All @@ -58,7 +68,7 @@ skip | | int | | пропустить указанное количество ф

**Пример запроса:**

`https://pastvu.com/api2?method=photo.giveNearestPhotos&params={"geo":[37.82,-122.469322],"limit":12,"except":228481}`
`https://api.pastvu.com/api2?method=photo.giveNearestPhotos&params={"geo":[37.82,-122.469322],"limit":12,"except":228481}`

### photo.getByBounds

Expand All @@ -75,5 +85,5 @@ localWork | | bool | 0 | возвращать массив `photos` (следу

**Пример запроса:**

`https://pastvu.com/api2?method=photo.getByBounds&params={"z":11,"geometry":{"type":"Polygon","coordinates":[[[37.29034423828125,55.56902805913944],[37.95501708984375,55.56902805913944],[37.95501708984375,55.92150795277898],[37.29034423828125,55.92150795277898],[37.29034423828125,55.56902805913944]]]}}`
`https://api.pastvu.com/api2?method=photo.getByBounds&params={"z":11,"geometry":{"type":"Polygon","coordinates":[[[37.29034423828125,55.56902805913944],[37.95501708984375,55.56902805913944],[37.95501708984375,55.92150795277898],[37.29034423828125,55.92150795277898],[37.29034423828125,55.56902805913944]]]}}`