Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.0
- servers:
- # Added by API Auto Mocking Plugin
- - description: SwaggerHub API Auto Mocking
- url: https://virtserver.swaggerhub.com/nyustit/rooms/5.0
- info:
- version: "5.0"
- title: Rooms
- description: This details the Rooms backend microservices API
- # security:
- # - openId:
- # - read
- paths:
- '/auth/login':
- post:
- description: Submits the netID and password of a user for authentication with Shibboleth
- requestBody:
- required: True
- content:
- 'application/json':
- schema:
- type: object
- required:
- - username
- - password
- properties:
- username:
- type: string
- example: rmr478
- password:
- type: string
- example: password
- responses:
- '200':
- description: Succesful response
- content:
- 'application/json':
- schema:
- type: object
- properties:
- token:
- type: string
- refreshToken:
- type: string
- #'/auth/token':
- # For refresh token
- #'/auth/logout':
- # For logout
- /closest:
- get:
- summary: Returns the closest open room
- parameters:
- - name: latitude
- in: query
- required: true
- description: The latitude of the user
- schema:
- type: number
- - name: longitude
- in: query
- required: true
- description: The longitude of the user
- schema:
- type: number
- responses:
- '200':
- description: Succesful response
- content:
- 'application/json':
- schema:
- $ref: '#/components/schemas/RoomTimes'
- '400':
- description: Latitude and/or Longitude were not provided
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: >-
- [Invalid Parameters] : Latitude and/or Longitude were not
- provided.
- '/users':
- get:
- summary: Returns the given user's reservations
- parameters:
- - name: user
- in: header
- schema:
- type: string
- responses:
- '200':
- description: Successful response
- content:
- 'application/json':
- schema:
- type: array
- items:
- $ref: '#/components/schemas/Reservation'
- '400':
- description: Invalid request
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: '[Invalid Request] : User may not be logged in.'
- '/locations/{locationId}':
- get:
- summary: Returns the given location's information
- parameters:
- - name: locationId
- in: path
- required: true
- description: 'id of the location to get, corresponds to the location shortCode'
- schema:
- type: string
- responses:
- '200':
- description: Successful response
- content:
- 'application/json':
- schema:
- $ref: '#/components/schemas/Location'
- '400':
- description: Invalid request
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: >-
- [Invalid request] : Location ID may be misspelled or
- nonexistent
- /locations:
- get:
- responses:
- '200':
- description: Successful response
- content:
- 'application/json':
- schema:
- type: array
- items:
- $ref: '#/components/schemas/Location'
- '/rooms/{roomId}':
- get:
- summary: Returns the given room's information
- parameters:
- - name: roomId
- in: path
- required: true
- description: Id of the room to get
- schema:
- type: string
- responses:
- '200':
- description: Successful response
- content:
- 'application/json':
- schema:
- $ref: '#/components/schemas/RoomTimes'
- '400':
- description: Invalid request
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: >-
- [Invalid Request] : Room ID may be misspelled or
- nonexistent
- /rooms:
- get:
- parameters:
- - name: locations
- in: query
- description: A stringified array of location shortcodes to search from
- required: false
- schema:
- type: string
- responses:
- '200':
- description: Successful request
- content:
- 'application/json':
- schema:
- type: array
- items:
- $ref: '#/components/schemas/Room'
- '400':
- description: Invalid request
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: '[Invalid Request]'
- /search:
- # Primary feature
- get:
- parameters:
- - name: openTime
- in: query
- description: The starting ISO format UTC datetime for the reservation
- required: false
- schema:
- type: string
- - name: locations
- in: query
- description: A stringified array of location shortcodes to search from
- required: false
- schema:
- type: string
- responses:
- '200':
- description: Successful request
- content:
- 'application/json':
- schema:
- $ref: '#/components/schemas/RoomTimes'
- '400':
- description: Invalid request
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: '[Invalid Request]'
- /reserve:
- post:
- summary: Submit a reservation
- responses:
- '201':
- description: Reservation made!
- content:
- 'application/json':
- schema:
- $ref: '#/components/schemas/Reservation'
- '400':
- description: 'Bad request: maybe some fields are missing?'
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: '[Invalid Request] : RoomID missing'
- '500':
- description: Reservation failed
- content:
- 'application/json':
- schema:
- type: object
- properties:
- message:
- type: string
- example: '[Reservation Failed] : Room already reserved'
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Reservation'
- description: Reservation request to make
- required: true
- # /survey:
- components:
- schemas:
- Room:
- type: object
- properties:
- id:
- type: string
- example: BOBST_LL2_29
- vendorId:
- type: string
- example: 123
- name:
- type: string
- example: LL2 29
- locationId:
- # shortcode of location
- type: string
- example: BOBST
- amenities:
- $ref: '#/components/schemas/Amenities'
- capacity:
- type: integer
- example: 5
- RoomTimes:
- type: object
- properties:
- room:
- $ref: '#/components/schemas/Room'
- times:
- type: array
- items:
- type: object
- properties:
- openTime:
- $ref: '#/components/schemas/DateString'
- duration:
- type: integer
- example: 1
- closeTime:
- $ref: '#/components/schemas/DateString'
- Reservation:
- type: object
- required:
- - roomId
- - locationId
- - openTime
- properties:
- username:
- type: string
- example: rmr478
- name:
- type: string
- example: Rayat Rahman
- email:
- type: string
- example: fake12@nyu.edu
- roomId:
- description: Id of the room to reserve in our system
- example: BOBST_LL2_29
- type: string
- vendorRoomId:
- description: Id of the room to reserve according to vendor
- example: LL2_29
- type: string
- locationId:
- type: string
- example: BOBST
- description: Id of the location the room is in
- openTime:
- $ref: '#/components/schemas/DateString'
- reserveTime:
- $ref: '#/components/schemas/DateString'
- duration:
- type: number
- example: 1.5
- description: Decimal number of hours room is being reserved for
- occupants:
- type: integer
- example: 2
- description: the number of occupants reserved for
- alternates:
- type: string
- example: [fake12@nyu.edu,fake23@nyu.edu]
- description: a stringified array of alternate email addresses to reserve for and
- send confirmation emails to
- supplementaryFields:
- $ref: '#/components/schemas/SuppFields'
- Location:
- type: object
- properties:
- name:
- type: string
- example: Bobst Library
- id:
- type: string
- example: BOBST
- message:
- type: string
- description: A specific message from the vendor to users
- example: This location is under construction. Room reservations at this location is only accessible for entrepreneurial activities.
- defaultAmenities:
- $ref: '#/components/schemas/Amenities'
- address:
- type: string
- example: '70 Washington Square S, New York, NY 10012'
- campus:
- type: string
- example: 'wsq'
- latitude:
- type: number
- example: 40.729619
- longitude:
- type: number
- example: -73.997025
- Amenities:
- type: array
- items:
- type: object
- properties:
- name:
- type: string
- example: Coffee
- id:
- # for generating icon on frontend
- type: string
- example: 12
- DateString:
- type: string
- example: '2007-04-05T12:30-02:00'
- description: ISO Format UTC datetime of reservation start time
- SuppFields:
- type: array
- description: An arbitrary array describing vendor-specific questions requested during reservation requests
- items:
- type: object
- properties:
- name:
- type: string
- example: 'heard'
- description:
- type: string
- example: 'Where did you hear about the CoOp?'
- required:
- type: boolean
- example: True
- response:
- type: string
- example: 'NYU Newsletter'
- # securitySchemes:
- # openId:
- # type: openIdConnect
- # openIdConnectUrl: https://example.com/.well-known/openid-configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement