HolidazeProfiles

Profiles

Profiles related to Holidaze

This endpoint allows you to manage profiles. They are the users of the Holidaze site.

These endpoints support pagination and sorting. Read more about these features here.

The Profile model

PropTypeDefault
name
string
-
email
string
-
banner
object
-
avatar
object
-
venueManager
boolean
-
_count
Object
-

Query parameters

Not all of the properties of a profile are returned by default. You can use the following optional query parameters to include additional properties in the response.

PropTypeDefault
_bookings
boolean
false
_venues
boolean
false
Example with all optional query parameters
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "venueManager": false,
    "venues": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "media": [
          {
            "url": "https://url.com/image.jpg",
            "alt": "string"
          }
        ],
        "price": 0,
        "maxGuests": 0,
        "rating": 0,
        "created": "string",
        "updated": "string",
        "meta": {
          "wifi": true,
          "parking": true,
          "breakfast": true,
          "pets": true
        },
        "location": {
          "address": "string",
          "city": "string",
          "zip": "string",
          "country": "string",
          "continent": "string",
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "bookings": [
      {
        "id": "string",
        "dateFrom": "string",
        "dateTo": "string",
        "guests": 0,
        "created": "string",
        "updated": "string",
        "venue": {
          "id": "string",
          "name": "string",
          "description": "string",
          "media": [
            {
              "url": "https://url.com/image.jpg",
              "alt": "string"
            }
          ],
          "price": 0,
          "maxGuests": 0,
          "rating": 0,
          "created": "string",
          "updated": "string",
          "meta": {
            "wifi": true,
            "parking": true,
            "breakfast": true,
            "pets": true
          },
          "location": {
            "address": "string",
            "city": "string",
            "zip": "string",
            "country": "string",
            "continent": "string",
            "lat": 0,
            "lng": 0
          }
        }
      }
    ],
    "_count": {
      "venues": 0,
      "bookings": 0
    }
  },
  "meta": {}
}

All profiles

GET/holidaze/profiles

Retrieve all profiles.

Response
{
  "data": [
    {
      "name": "string",
      "email": "user@example.com",
      "bio": "string",
      "avatar": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "banner": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "venueManager": false,
      "_count": {
        "venues": 0,
        "bookings": 0
      }
    },
    {
      "name": "string",
      "email": "user@example.com",
      "bio": "string",
      "avatar": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "banner": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "venueManager": false,
      "_count": {
        "venues": 0,
        "bookings": 0
      }
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single profile

GET/holidaze/profiles/<name>

Retrieve a single profile by its id.

Response
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "venueManager": false,
    "_count": {
      "venues": 0,
      "bookings": 0
    }
  },
  "meta": {}
}

All bookings by profile

GET/holidaze/profiles/<name>/bookings

Retrieve all bookings made by profile.

The response is the same as the bookings endpoint, and accepts the same optional query parameters and flags.

Response
{
  "data": [
    {
      "id": "string",
      "dateFrom": "string",
      "dateTo": "string",
      "guests": 0,
      "created": "string",
      "updated": "string"
    },
    {
      "id": "string",
      "dateFrom": "string",
      "dateTo": "string",
      "guests": 0,
      "created": "string",
      "updated": "string"
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

All venues by profile

GET/holidaze/profiles/<name>/venues

Retrieve all venues made by profile.

The response is the same as the venues endpoint, and accepts the same optional query parameters and flags.

Response
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "media": [
        {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      ],
      "price": 0,
      "maxGuests": 0,
      "rating": 0,
      "created": "string",
      "updated": "string",
      "meta": {
        "wifi": true,
        "parking": true,
        "breakfast": true,
        "pets": true
      },
      "location": {
        "address": "string",
        "city": "string",
        "zip": "string",
        "country": "string",
        "continent": "string",
        "lat": 0,
        "lng": 0
      }
    },
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "media": [
        {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      ],
      "price": 0,
      "maxGuests": 0,
      "rating": 0,
      "created": "string",
      "updated": "string",
      "meta": {
        "wifi": true,
        "parking": true,
        "breakfast": true,
        "pets": true
      },
      "location": {
        "address": "string",
        "city": "string",
        "zip": "string",
        "country": "string",
        "continent": "string",
        "lat": 0,
        "lng": 0
      }
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Update profile

PUT/holidaze/profiles/<name>

Update or set bio, venueManager, banner and avatar properties.

You may provide any combination of the properties, but at least one must be provided.

Please note that the avatar.url and banner.url properties must be fully formed URLs that links to live and publicly accessible images. The API will check the provided URLs and if they cannot be accessed publicly you will receive a 400 Bad Request error response.

Request
{
  "bio": "string",
  "avatar": {
    "url": "https://url.com/image.jpg",
    "alt": "string"
  },
  "banner": {
    "url": "https://url.com/image.jpg",
    "alt": "string"
  },
  "venueManager": true
}
Response
{
  "data": {
    "name": "string",
    "email": "user@example.com",
    "bio": "string",
    "avatar": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "banner": {
      "url": "https://url.com/image.jpg",
      "alt": "string"
    },
    "venueManager": true
  },
  "meta": {}
}

Search profiles

GET/holidaze/profiles/search?q=<query>

Search for profiles by their name or bio properties.