Overview

About

The Transpyr back-end api is a Node/Express REST API that handles Transpyr's user, event, and booking operations.

The API is designed to be consumed by the front-end application, which is written in React.js.

Setup

Starting the server

npm start starts the server.

npm run start-dev runs the server with nodemon.

Configuration

The following environment variables are required to run the API:

See Environment Variables

Server config

  • NODE_ENV

    The environment to run the API in. This can be either development or production.

  • PORT

    The port to run the API on.

    Default: 3000

  • FRONTEND_HOST

    The hostname of the front-end application.

    Required for links contained in automated emails to work.

    Sets 'domain' of refresh token's set-cookie header.

    In production, Transpyr and transpyr-api must be on the same domain for refresh tokens to work due to cross-origin cookies being blocked by modern browsers.

Database config

transpyr-api uses MongoDB Atlas to host its database.

  • DB_URL

    mongodb://[username:@]host1[:port1],...hostN[:portN]][/[defaultauthdb][?options]]

    MongoDB connection string

    <PASSWORD> should be preserved. It is replaced programatically with the DB_PASS environment variable.

  • DB_PASS

    MongoDB user password.

JWT config

  • JWT_SECRET

    The secret used to sign JWTs.

    At least 32 character length recommended

  • JWT_EXPIRES_IN

    The number of milliseconds a JWT is valid for.

    Recommended: 900000 (15 minutes)

DEVELOPMENT email config

The development email service is usually something like Mailtrap.

  • EMAIL_USERNAME

    Development email host username.

  • EMAIL_PASSWORD

    Development email host password.

  • EMAIL_HOST

    Development email host.

  • EMAIL_PORT

    Development email host port.

  • EMAIL_FROM

    The email address to send emails from.

PRODUCTION email config

transpyr-api uses SendGrid for emails in production.

  • SENDGRID_USERNAME

    Usually 'apikey'.

  • SENDGRID_PASSWORD

    The API key or password for SendGrid.

Stripe config

transpyr-api uses a development implementaton of Stripe for payments.

The api was not built for use with real payments, and lacks business logic required to support real payments.

  • STRIPE_SECRET_KEY

    The secret key for Stripe.

  • STRIPE_WEBHOOK_SECRET

    The secret key for authorizing Stripe webhook requests.

AWS config

transpyr-api needs to access an S3 bucket to store and stream user and event photos.

  • AWS_ACCESS_KEY_ID

    The AWS access key ID.

  • AWS_SECRET_ACCESS_KEY

    The AWS secret access key.

  • AWS_BUCKET

    The name of the S3 bucket to use.

Resources

Event

Details
  • id: String. ID of event.
  • name: String. Name of the event.
  • type: String. Format of the event.
    • Allowed values: Lecture, Class, Performance, Social, Workshop, Conference, Convention, Expo, Game, Rally, Screening, Tour
  • category: String. Category of event.
    • Allowed values: Business, Food, Health & Lifestyle, Music, Vehicle, Charity, Community, Fashion, Film, Home, Hobbies, Performing & Visual Arts, Politics, Spirituality, School, Science & Technology, Holiday, Sports & Fitness, Travel, Outdoor & Recreation, Other
  • description: String. Description of the event in Markdown.
  • convertedDescription: String. Generated copy of event description, sanitized and converted to HTML
  • ticketTiers: TicketTier[]. Array of event ticket types.
  • photo: String. Filename of event photo.
  • dateTimeStart: Date. Start date and time of event.
  • dateTimeEnd: Date. End date and time of event.
  • createdAt: Date. Creation date and time of event.
  • organizer: String. ID of event organizer.
  • address: String. Optional event address if the event is in-person.
  • location: Location.
    • type: String. Value must be "Point".
    • coordinates: Array. Location coordinates expressed [longitude, latitude].
    • totalCapacity: Number. Total number of available tickets for event.
    • totalBookings: Number. Total number of current bookings for event.
    • feePolicy: String. Specifies whether booking fees should be covered by the organizer or passed to attendees.
      • Allowed values: absorbFee, passFee
    • refundPolicy: String. Optional refund policy for event.
    • language: String. Language event is presented in.
    • online: Boolean. Specifies if event includes online attendance.
    • canceled: Boolean. Specifies if event is canceled.
    • published: Boolean. Specifies if event is published.
    • soldOut: Boolean. Specifies if event is sold out.

TicketTier

Details
  • id: String. ID of ticket.
  • tierName: String. Ticket name.
  • tierDescription: String. Ticket description.
  • price: Number. Ticket price.
  • online: Boolean. Specifies if ticket is for online attendance.
  • capacity: Number. Number of tickets available.
  • limitPerCustomer: Number. Maximum number of bookings allowed per order.
  • canceled: Boolean. Specifies if ticket is canceled.
  • numBookings: Number. Current number of bookings for ticket.
  • ticketSoldOut: Boolean. Specifies if ticket is sold out.

User

Details
  • id: String. ID of user.
  • name: String. The name of the user.
  • email: String. The email address of the user.
  • password: String. Hashed password of the user.
    • This field is not accessible by any endpoint.
  • createdAt: Date. Date and time of user creation.
  • photo: String. Filename of user photo.
  • tagline: String. Short introduction of the user.
  • bio: String. A longer description of the user.
  • interests: String. A description of the user's interests.
  • favorites: String[]. An array of event IDs belonging to the user's favorites.
  • privateFavorites: Boolean. Specifies if the user's favorites are sent with their public profile.
  • role: String. Specifies if the user is an admin or regular user.
  • active: Boolean. Specifies if user is active.
  • passwordChangedAt: Date. The date and time of the user's last password change.
  • passwordResetToken: String. Hashed password reset token.
  • passwordResetExpires: Date. Date and time user's password reset token expires.

Booking

Details
  • id: String. ID of booking.
  • orderId: String. ID of order the booking is a part of.
  • name: String. Name associated with the booking.
  • email: String. Email associated with the booking.
  • user: String. ID of user optionally associated with the booking.
  • event: String. ID of booked event.
  • ticket: String. ID of booked event ticket type.
  • price: Number. Price of the ticket at the time of booking.
  • createdAt: Date. Date and time of booking creation.
  • paid: Boolean. Specifies if booking has been paid for.
  • active: Boolean. Specifies if booking is active or canceled.
  • refundRequest: RefundRequest. Contains an associated refund request if applicable.

RefundRequest

Details
  • id: String. UUID of the unique request document.
  • requestId: String. ID of the refund request that the request belongs to.
  • createdAt: Date. Date and time of refund request creation.
  • resolved: Boolean. Specifies if a decision has been made about the request.
  • status: String. The status of a resolved refund request.
    • Allowed values: accepted, rejected
    • reason: String. Optional reason for the refund request.
    • refundProcessed: Boolean. Specifies if the refund payment has processed (not implemented).

API Root

Stream image from Amazon S3

GET /image/:folder/:id.jpg
Details

URL Params

  • :folder String

    The folder in which the image is stored.

    Either events or users.

  • :id String

    The the id of the user or image whose photo you are requesting.

    Images are always stored as JPEGs. The .jpeg extension should always be specified.

Response

image/jpeg

The requested image.

Stripe webhook checkout

POST /webhook-checkout

Don't hit this endpoint directly.

Add a webhook from the Stripe dashboard to request this endpoint on the checkout.session.completed event.

Events

Get all events

GET /events
Details

Query Params

  • [field] String

    The key should correspond to a field in the events resource. The value is the value of that field you want to match in the results.

    eg. category=Lecture

  • sort String

    Sorts returned events by the specified field. Accepts two field names, space separated. If events have equal values for the first sorting field, they will be sorted by the second field.

    Prefixing the fieldname with - will sort descending. Otherwise it sorts ascending.

    eg. sort=totalCapacity -createdAt

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned events. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,dateTimeStart

    INVALID eg. fields=name,photo,-ticketTiers

  • loc JSON String
    Returns events within a specified radius around a specified coordinate pair.

    "center": A comma-separated pair of coordinates, expressed "longitude,latitude".

    "radius": The radius around the center in miles.

    eg. loc={"center":"-86.8893739,36.0853771","radius":"50"}

  • search String

    A case-insensitive search string that returns events matching the event name or description.

    eg. search=yoga

  • paginate JSON String

    Returns results in separate pages according to the specified limit. In addition to the events, it supplies the total number of events, current page, and total number of pages.

    "page": The requested page number.

    "limit": The number of results per page.

    eg. paginate={"page":1,"limit":8}

Response

JSON

  • status: String.
  • results: Number. Number of returned documents.
  • data: Object.
    • data: Event[]. The returned event documents.
    • total: Number. (Optional) The total number of documents when using pagination.
    • page: Number. (Optional) The current page when using pagination.
    • pages: Number. (Optional) The total number of pages when using pagination.

Get one event

GET /events/:id
Details

URL Params

  • :id String

    The id of the requested event.

Query Params

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned events. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,dateTimeStart

    INVALID eg. fields=name,photo,-ticketTiers

Response

JSON

  • status: String.
  • data: Object.
    • data: Event. The requested event document.

Create an event

POST /events

Authorization required

Body: application/json

  • name String

    Required

    The name of the event.

    • Required.
    • Must be at least 8 characters.
    • Cannot exceed 75 characters.
  • type String

    Required

    The event type (format).

    • Required.
    • Allowed values: 'Lecture', 'Class', 'Performance', 'Social', 'Workshop', 'Conference', 'Convention', 'Expo', 'Game', 'Rally', 'Screening', 'Tour'
  • category String

    Required

    The event category.

    • Required.
    • Allowed values: 'Business', 'Food', 'Health & Lifestyle', 'Music', 'Vehicle', 'Charity', 'Community', 'Fashion', 'Film', 'Home', 'Hobbies', 'Performing & Visual Arts', 'Politics', 'Spirituality', 'School', 'Science & Technology', 'Holiday', 'Sports & Fitness', 'Travel', 'Outdoor & Recreation', 'Other'
  • description String

    Required

    The description of the event.

    • Required.
    • The description is parsed from Markdown to HTML on event creation. New lines are represented with the \n newline character.
  • dateTimeStart Date

    Required

    The start date and time of the event.

    • Required.
    • The start date must be in the future. newline character.
  • dateTimeEnd Date

    Required

    The end date and time of the event.

    • Required.
    • The end date must be after the start date. newline character.
  • ticketTiers TicketTier[]

    Required

    The ticket tiers for the event.

    • At least one ticket is required.
    • An event can have a maximum of 10 ticket tiers.
    • Total ticket capacities cannot exceed the event total capacity. When all tickets have a limited capacity (greater than 0), they must equal the event total capacity.
    TicketTier
    • tierName: String. Required. The name of the ticket tier. Must be unique. Cannot exceed 50 characters.
    • tierDescription: String. Required. The description of the ticket tier. Cannot exceed 150 characters.
    • price: Number. Required. The price of the ticket tier. Must be greater than or equal to 0.
    • online: Boolean. Requied. Specifies if the ticket is for virtual attendance.
    • capacity: Number. The number of tickets available. Must be greater than or equal to 0. A value of 0 indicates that there is no limit.
    • limitPerCustomer: Number. The number of tickets available per order. Must be greater than or equal to 0. A value of 0 indicates that there is no limit. Must be less than or equal to the capacity.
  • location Location

    The location of the event.

    • Required when the address field is specified.
    Location
    • coordinates: [number, number]. Required. Coordinates are expressed as longitude, latitude.
  • address String

    The address of the event.

    • Required when the location field is specified.
  • totalCapacity Number

    The total number of available event tickets.

    • Required.
    • Must be greater than or equal to 0. A value of 0 indicates there is no capacity limit.
    • Must be eq

Response

JSON

  • status: String.
  • data: Object.
    • data: Event. The created event document.

Upload event photo

PATCH /events/:id

Authorization required

URL Params

  • :id String

    The id of the event.

Body: multipart/form-data

  • photo Image

    Required

    A valid image file to be uploaded.

Response

JSON

  • status: String.
  • data: Object.
    • data: Event. The created event documents.

Edit an event

PUT /events/:id

Authorization required

URL Params

  • :id String

    The id of the event to edit.

Body: application/json

Response

JSON

  • status: String.
  • data: Object.
    • data: Event. The created event documents.

Publish an event

PATCH /events/:id/publish

Authorization required

Specify a fee policy and optional refund policy to publish an event

URL Params

  • :id String

    The id of the event to publish.

Body: application/json

  • feePolicy String

    Required

    Allowed values: 'passFee', 'absorbFee'.

    absorbFee takes Transpyr's service fee from the organizer's earnings.

    passFee adds Transpyr's service fee to the ticket price.

  • refundPolicy String

    Optional refund policy.

Response

JSON

  • status: String.
  • data: Object.
    • data: Event. The created event documents.

Get all own events

GET /events/me

Authorization required

Query params

  • Same as Get All Events.
  • It is not possible to query for other organizer's events from this route.
  • Unlike Get All Events, this route responds with the user's unpublished events.

Response

JSON

  • status: String.
  • results: Number. Number of returned documents.
  • data: Object.
    • data: Event[]. The returned event documents.
    • total: Number. (Optional) The total number of documents when using pagination.
    • page: Number. (Optional) The current page when using pagination.
    • pages: Number. (Optional) The total number of pages when using pagination.

Cancel an event ticket tiers

DELETE /events/:id/ticket/:ticketId

Authorization required

Cancel an event ticket.

URL Params

  • :id String

    The id of the event.

  • :ticket String

    The id of the ticket to cancel.

Response

204: No Content

Get own booked events

GET /events/me/booked

Authorization required

Returns events the user has booked, with the total number of bookings for each.

It is not possible to query for other organizer's events from this route.

Unlike Get All Events, this route responds with the user's unpublished events.

Query params

  • [field] String

    The key should correspond to a field in the events resource. The value is the value of that field you want to match in the results.

    eg. category=Lecture

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned events. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,dateTimeStart

    INVALID eg. fields=name,photo,-ticketTiers

Response

JSON

  • status: String.
  • results: Number. Number of returned documents.
  • data: Object.
    • data: Event[]. The returned event documents.
      • total: Number. Number of user bookings for event.

Admin-only actions

Users with the admin role can use normal routes with extra functionality.

  • Get Events returns all events, published and unpublished.
  • Admins can edit and publish any event.
  • Admins can cancel and delete events and their tickets.

Users

Sign in

POST /users/signin

Body: application/json

  • email String

    Required

    Valid email address of the user.

  • password String

    Required

    Password of the user.

Response

JSON

  • status: String.
  • token: String. JSON web token, which is sent in the authorization header to access protected routes.
  • expiresIn: Number. The amount of time in milliseconds for which the JWT is valid.
  • data: Object.
    • user: User. The returned user document.

Sign up

POST /users/signup

Body: application/json

  • name String

    Required

    Name for the user.

    • Must be under 42 characters.
  • email String

    Required

    Email address for the account.

    • Must be a valid email address.
    • Must not already be in use.
  • password String

    Required

    Password for the account.

    • Must be at least 8 characters long.
  • passwordConfirm String

    Required

    Confirmation of the password.

    • Must match the password field.

Response

JSON

  • status: String.
  • token: String. JSON web token, which is sent as a Bearer token in the authorization header to access protected routes.
  • expiresIn: Number. The amount of time in milliseconds for which the JWT is valid.
  • data: Object.
    • user: User. The returned user document.

Refresh token

GET /users/refresh-token

If a valid refresh token is sent in a secure, HTTPOnly cookie, the refresh token and JWT are replaced and returned.

Response

JSON

  • status: String.
  • token: String. JSON web token, which is sent as a Bearer token in the authorization header to access protected routes.
  • expiresIn: Number. The amount of time in milliseconds for which the JWT is valid.
  • data: Object.
    • user: User. The returned user document.

Revoke token

DELETE /users/refresh-token

Authorization required

Revokes a refresh token sent in either the body of the request or a secure HTTPOnly cookie, rendering it invalid for refreshing a JWT.

Body: application/json

  • token String

    Optional. A valid refresh token (which was issued to the current user) to revoke.

Response

204 No Content

Forgot password

POST /users/forgot-password

Begins the password reset process by sending an email containing a link with a password reset token to a valid user email address.

Body: application/json

  • email String

    Required

    Email of the user.

    • Must be a valid email address corresponding to an active user.

Response

JSON

  • status: String.
  • message: String. Value is 'Email sent!' upon success.

Reset password

PATCH /users/reset-password/:token

URL Params

  • :token String

    Required

    Valid password reset token received in the "forgot password" email.

Body: application/json

  • password String

    Required

    Password for the account.

    • Must be at least 8 characters long.
  • passwordConfirm String

    Required

    Confirmation of the password.

    • Must match the password field.

Response

JSON

  • status: String.
  • message: String. Value is 'Password changed successfully!' upon success.

Get public user profile

GET /profile/:id

URL Params

  • :id String

    Required

    User ID.

Query Params

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned user profile. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,events

    INVALID eg. fields=name,photo,-favorites

  • paginate JSON String

    Returns events in the 'favorites' and 'events' fields in separate pages according to the specified limit.

    "page": The requested page number.

    "limit": The number of results per page.

    eg. paginate={"page":1,"limit":8}

Response

JSON

  • status: String.
  • data: Object.
    • user: User. The returned user document.

Update password

PATCH /users/update-password

Authorization required

Logged in users can use this endpoint to change their passoword.

Body: application/json

  • password String

    Required

    Current password for the account.

  • newPassword String

    Required

    New password for the account.

    • Must be at least 8 characters long.
  • newPasswordConfirm String

    Required

    Confirmation of the new password.

    • Must match the newPassword field.

Response

204 No Content

Get own user

GET /users/me

Authorization required

Gets logged in user's document.

Response

JSON

  • status: String.
  • data: Object.
    • data: User. The returned user document.

Update own user

PATCH /users/me

Authorization required

Used to edit the currently logged-in user. Contains either FormData for changing the user's photo or JSON for editing the user's info.

Upload user photo: multipart/form-data

  • photo image

    A valid image file to be uploaded.

Edit user: application/json

  • name string

    User name.

    • Maximum of 42 characters.
  • email string

    User email.

    • Must be a valid email address.
  • privateFavorites boolean

    Whether or not the user's favorites should be private.

  • favorites string[]

    Array of user's favorite events.

    • Must contain IDs of the events.
  • bio string

    A longer description of the user.

    • Maximum of 1000 characters.
  • interests string

    Some info about the user's interests and goals.

    • Maximum of 500 characters.
  • tagline string

    A short phrase to be displayed at the top of a user's profile, as well as in the "organizer" section of their events.

    • Maximum of 150 characters.

Response

JSON

  • status: String.
  • data: Object.
    • user: User. The returned user document.

Deactivate own user

DELETE /users/me

Authorization required

Deactivate the currently logged-in user.

Response

204: No Content

Admin-only actions

Get all users

GET /users

Admin authorization required

Details

Query Params

  • [field] String

    The key should correspond to a field in the events resource. The value is the value of that field you want to match in the results.

    eg. category=Lecture

  • sort String

    Sorts returned events by the specified field. Accepts two field names, space separated. If events have equal values for the first sorting field, they will be sorted by the second field.

    Prefixing the fieldname with - will sort descending. Otherwise it sorts ascending.

    eg. sort=totalCapacity -createdAt

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned events. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,dateTimeStart

    INVALID eg. fields=name,photo,-ticketTiers

  • loc JSON String
    Returns events within a specified radius around a specified coordinate pair.

    "center": A comma-separated pair of coordinates, expressed "longitude,latitude".

    "radius": The radius around the center in miles.

    eg. loc={"center":"-86.8893739,36.0853771","radius":"50"}

  • search String

    A case-insensitive search string that returns events matching the event name or description.

    eg. search=yoga

  • paginate JSON String

    Returns results in separate pages according to the specified limit. In addition to the events, it supplies the total number of events, current page, and total number of pages.

    "page": The requested page number.

    "limit": The number of results per page.

    eg. paginate={"page":1,"limit":8}

Response

JSON

  • status: String.
  • results: Number. Number of returned documents.
  • data: Object.
    • data: User[]. The returned user documents.
    • total: Number. (Optional) The total number of documents when using pagination.
    • page: Number. (Optional) The current page when using pagination.
    • pages: Number. (Optional) The total number of pages when using pagination.

Get one user

GET /users/:id

Admin authorization required

Details

URL Params

  • :id String

    The id of the requested user.

Response

JSON

  • status: String.
  • data: Object.
    • data: User. The requested user document.

Update user

PATCH /users/:id

Admin authorization required

Used to edit any user's document. Contains either FormData for changing the user's photo or JSON for editing the other fields.

Upload user photo: multipart/form-data

  • photo image

    A valid image file to be uploaded.

Edit user: application/json

  • Possible fields match the user model.
  • Attempting to include a password field will return an error.

Response

JSON

  • status: String.
  • data: Object.
    • user: User. The returned user document.

Delete user

DELETE /users/:id

Admin authorization required

Deletes a user's document permanently.

URL Params

  • :id String

    A valid user ID.

Response

204 No Content

Bookings

Create Stripe checkout session

POST /bookings/checkout-session/:eventId

Authorization optional

URL Params

  • :eventId String

    Valid ID of event to be booked.

Body: application/json

  • name String

    Required

    Name for the bookings.

  • email String

    Required

    Email address for the bookings.

  • tickets TicketSelections

    Required

    An object containing selected ticket ID keys with the selected quantity as a value.

    TicketSelections
    • [ticketId]: Number. Required. The selected quantity of the ticket.

Response

JSON

  • status: String.
  • id: String. The Stripe checkout session ID.

Get order bookings

GET /bookings/order/:id

URL params

  • :id String

    The order ID.

Response

JSON

  • status: String.
  • length: Number. Number of returned documents.
  • data: Event[]. The returned booking documents.

Get own bookings

GET /bookings/me

Authorization required

Details

Query Params

  • [field] String

    The key should correspond to a field in the bookings resource. The value is the value of that field you want to match in the results.

    eg. event=60266cadc727a6c634a445de

  • sort String

    Sorts returned events by the specified field. Accepts two field names, space separated. If events have equal values for the first sorting field, they will be sorted by the second field.

    Prefixing the fieldname with - will sort descending. Otherwise it sorts ascending.

    eg. sort=-createdAt

Response

JSON

  • status: String.
  • length: Number. Number of returned documents.
  • data: Booking[]. The returned booking documents.
    • event: Event. The populated event data.
    • ticketData: TicketTier. The document for the booking's corresponding ticket.

Get all refund requests for event

GET /bookings/refund-requests/event/:id

Authorization required

Details

URL Params

  • :id String

    The ID of the event.

Response

JSON

  • status: String.
  • length: Number. Number of returned documents.
  • data: Booking[]. The returned booking documents.

Get refund request

GET /bookings/refund-requests/:id

Authorization required

Details

URL Params

  • :id String

    The ID of the refund request.

Response

JSON

  • status: String.
  • length: Number. Number of returned documents.
  • data:
    • requestId: String. Refund request ID.
    • name: String. Name associated with refund request bookings.
    • email: String. Email associated with refund request bookings.
    • createdAt: Date. Request creation date.
    • reason: String. Optional reason for request.
    • event:
      • id: String. ID of event associated with refund request bookings.
      • name: String. Name of event associated with refund request bookings.
      • organizer: String. ID of event organizer.
    • tickets: Array. Contains all tickets in the refund request.
      • price: Number. Price of individual ticket.
      • ticket: TicketTier. Data of individual ticket.

Admin-only actions

Get all bookings

GET /bookings

Admin authorization required

Details

Query Params

  • [field] String

    The key should correspond to a field in the events resource. The value is the value of that field you want to match in the results.

    eg. paid=false

  • sort String

    Sorts returned events by the specified field. Accepts two field names, space separated. If events have equal values for the first sorting field, they will be sorted by the second field.

    Prefixing the fieldname with - will sort descending. Otherwise it sorts ascending.

    eg. sort=price -createdAt

  • fields String

    Specifies a comma-separated (with no spaces) list of fields to include in the returned events. Prefixing a field with - will exclude that field and include all others. Explicit exclusion cannot be combined with inclusion.

    VALID eg. fields=name,email

    INVALID eg. fields=name,email,-price

Response

JSON

  • status: String.
  • length: Number. Number of returned documents.
  • data: Booking[]. The returned booking documents.

Get booking

GET /bookings/:id

Admin authorization required

Details

URL Params

  • :id String

    The id of the requested booking.

Response

JSON

  • status: String.
  • data: Object.
    • data: Booking. The requested booking.