Skip to content
heyniki edited this page Jan 19, 2014 · 9 revisions

/api/get_coords

Expects parameters:

  • lat: Latitude
  • lon: Longitude

Gets a list of Foursquare venues given a lat/long pair. Returns them in a JSON format with the fields:

  • name: venue name
  • id: Foursquare venue ID
  • lat: Latitude of venue
  • lng: Longitude of venue
  • hereNow: Number of users currently checked in at the venue

/api/refine_search

Expects parameters:

  • lat: Latitude
  • lon: Longitude
  • term : Search term

Gets a list of Foursquare venues given a lat/long pair and a search term. Returns them in a JSON format with the fields:

  • name: venue name
  • id: Foursquare venue ID
  • lat: Latitude of venue
  • lng: Longitude of venue
  • hereNow: Number of users currently checked in at the venue

/api/add_listing

POST, takes inputs:

  • location
  • price (this is stored as text for some reason. blame tim
  • status (I do not know what a status is. blame tim
  • userId (blame tim for the weirdo capitalisation)

returns [{'status':'success', 'hash':<your-shitty-hash-here>}]

/api/get_listings

GET, takes inputs:

  • by: currently takes hash or recent. with hash, you feed it a hash, hopefully previously returned by a call to add_listing. with recent, you pass an additional input until.
  • hash: only pass if by=hash. should be obvious.
  • until: only pass if by=recent. indicates how many hours into the past you want to retrieve listings from.

/api/get_all_listings_ascending

GET, takes no inputs (as of now. may be redesigned to do fancier stuff. returns a priority queue (https://npmjs.org/package/priorityqueuejs).

/api/match_made_SMS

GET, sends an SMS to a number. Maximum 75 per IP address per day. Takes inputs:

  • number (the phone number to SMS to)

/api/match_made_email

GET, sends an email. Takes inputs:

  • email (the recipient's email address)

/api/get_all_chats

GET, just prints out all the chat messages in the database. Used for debugging. Takes no inputs.

/api/get_chats

GET, gets the chats between 2 people from a specified ID and newer. Takes inputs:

  • from (the ID of the person sending the message)
  • to (the ID of the person receiving the message)
  • lastID (the ID of the last message that the client currently has)

/api/send_message

POST, updates chat when the user sends a message. Takes inputs:

  • from (the ID of the person sending the message)
  • to (the ID of the person receiving the message)
  • msg (the message sent)