Skip to content
Documentation
pozyskajpacjentaDocs

API referenceContent

List locations

GET/api/v1/locations

Since
1.11.0
Auth
Bearer key
operationId
listLocations

The clinic's active locations, the primary one first. A clinic with one location answers one, with the clinic profile's address, phone and hours. Use it for a locations page, a location picker or one JSON-LD entry per location. Responses are private to the key: Cache-Control: private, max-age=60, so cache them on your side for up to a minute.

Request

Send the clinic's key in Authorization: Bearer (see API keys).

No parameters and no body.

curl "https://app.pozyskajpacjenta.pl/api/v1/locations" \
  -H "Authorization: Bearer $PP_API_KEY"
import { PozyskajPacjentaClient } from "@pozyskajpacjenta/sdk";

const client = new PozyskajPacjentaClient({
  apiKey: process.env.PP_API_KEY ?? "",
  baseUrl: "https://app.pozyskajpacjenta.pl",
});

const { locations } = await client.listLocations();
<?php
$response = wp_remote_get(
    'https://app.pozyskajpacjenta.pl/api/v1/locations',
    array(
        'headers' => array( 'Authorization' => 'Bearer ' . getenv( 'PP_API_KEY' ) ),
        'timeout' => 10,
    )
);
if ( is_wp_error( $response ) ) {
    error_log( $response->get_error_message() );
    return;
}
$status = wp_remote_retrieve_response_code( $response );
$data   = json_decode( wp_remote_retrieve_body( $response ), true );

Response

200The clinic's locations.

  • locationsLocation[]required

    Active locations, the primary one first.

    Fields of each item (11)
    • idstringrequired

      Location id.

    • slugstringrequired

      The location's address part, unique within the clinic.

    • namestringrequired

      Name of the location, e.g. the town or the district.

    • primarybooleanrequired

      true for the primary location (its values are the clinic profile's).

    • phonestring

      Phone number for display. For a tel: link keep the digits and the +.

    • emailstring (email)

      The location's contact e-mail.

    • addressSiteAddress

      The location's address.

      Fields (5)
      • streetstringrequired

        Street and number.

      • postalCodestringrequired

        Postal code, 00-000.

      • citystringrequired

        City.

      • districtstring

        District, e.g. Mokotów.

      • accessNotestring

        How to get in: entrance, floor, parking, lift.

    • geoobject

      Map point of the location.

      Fields (2)
      • latnumberrequired

        Latitude.

      • lngnumberrequired

        Longitude.

    • openingHoursOpeningHours

      Opening hours per weekday.

      Fields (7)
      • monOpeningInterval[]

        Monday's intervals.

        Fields of each item (2)
        • opensstringrequired

          Opening time, HH:MM.

        • closesstringrequired

          Closing time, HH:MM, later than opens.

      • tueOpeningInterval[]

        Tuesday's intervals.

        Fields as in OpeningInterval above.

      • wedOpeningInterval[]

        Wednesday's intervals.

        Fields as in OpeningInterval above.

      • thuOpeningInterval[]

        Thursday's intervals.

        Fields as in OpeningInterval above.

      • friOpeningInterval[]

        Friday's intervals.

        Fields as in OpeningInterval above.

      • satOpeningInterval[]

        Saturday's intervals.

        Fields as in OpeningInterval above.

      • sunOpeningInterval[]

        Sunday's intervals.

        Fields as in OpeningInterval above.

    • openingHoursNotestring

      Note shown next to the hours.

    • nfzobject

      Contract with the National Health Fund (NFZ) at this location.

      Fields (2)
      • contractbooleanrequired

        true when the location has an NFZ contract.

      • notestring

        Note about the NFZ contract.

A clinic with two locations

{
  "locations": [
    {
      "id": "loc_krakow",
      "slug": "krakow",
      "name": "Kraków",
      "primary": true,
      "phone": "+48 12 100 20 30",
      "address": {
        "street": "ul. Długa 1",
        "postalCode": "30-001",
        "city": "Kraków"
      },
      "openingHours": {
        "mon": [
          {
            "opens": "08:00",
            "closes": "18:00"
          }
        ]
      },
      "nfz": {
        "contract": false
      }
    },
    {
      "id": "loc_wieliczka",
      "slug": "wieliczka",
      "name": "Wieliczka",
      "primary": false,
      "phone": "+48 12 555 44 33",
      "address": {
        "street": "Rynek Górny 2",
        "postalCode": "32-020",
        "city": "Wieliczka"
      },
      "openingHours": {
        "tue": [
          {
            "opens": "09:00",
            "closes": "17:00"
          }
        ]
      }
    }
  ]
}

Errors

StatusWhen
401No Authorization header
401Unknown or rotated key
429Over 120 requests in this minute

Branch on the status and code, never on the Polish error text. All statuses in Errors.

401 · No Authorization header
{
  "error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}
401 · Unknown or rotated key
{
  "error": "invalid key"
}
429 · Over 120 requests in this minute
{
  "error": "przekroczono limit 120 zapytań/min"
}

Rate limit

  • 120 requests per minute per key, shared by every endpoint.
  • Every response to a valid key carries RateLimit-Remaining and RateLimit-Reset; see Rate limits.

SDK method

client.listLocations(): Promise<{ locations: Location[] }>

The TypeScript tab above uses it. Install and errors: TypeScript SDK.