ArtsyApp API Documentation
API Documentation for CS4518 Group 3 final project.
License: MIT
cookieAuth
apiKey
API Key
Description
Express session cookie
In
cookie
Name
connect.sid
Deletes the account of the attached user session
Name
Located in
Description
Required
Schema
Code
Description
Schema
200
Account deleted successfully
400
Unable to find user attached to session
Error
500
Error deleting user
Error
Security Schema
Scopes
cookieAuth
Validates a user with Google credentials. Creates a new account if no matching account exists
Name
Located in
Description
Required
Schema
id_token
query
Google OAuth2 idToken.
Yes
string
Check if user is currently authenticated.
Name
Located in
Description
Required
Schema
Code
Description
Schema
200
Includes user if authenticated
AuthenticationResponse
500
Failed to retrieve user by the id attached to their session
Signs out user
Name
Located in
Description
Required
Schema
Code
Description
200
Sign out successful
Security Schema
Scopes
cookieAuth
Creates a new post from the user's current location and drawing bitmap.
Name
Located in
Description
Required
Schema
lat
required
Latitude coordinate for Post
No
float
lon
required
Longitude coordinate for Post
No
float
content
required
Raw bitmap data of drawing
No
string
Code
Description
Schema
201
Post created successfully
Post
400
Missing required parameters
Error
500
Unable to create post (backend error)
Error
Security Schema
Scopes
cookieAuth
Deletes a post. A post may only be deleted by the user who created it.
Name
Located in
Description
Required
Schema
id
required
ID of post to delete
No
string
Code
Description
Schema
200
Deletion completed successfully
403
Not authorized to delete post
Error
404
Post not found
Error
500
Failed to process request
Error
Security Schema
Scopes
cookieAuth
Retrieves post by its ID. If Authenticated, vote related information will be shown.
Name
Located in
Description
Required
Schema
id
required
ID of post to request
No
string
Code
Description
Schema
200
Post data retrieved
Post
404
Post not found
Error
Downvotes as authenticated user. Acts as an unvote if user has already downvoted, and removes upvote if applicable.
Name
Located in
Description
Required
Schema
id
required
ID of post to upvote
No
string
Code
Description
Schema
200
The post score along with user's new vote_status for the post
Vote
403
Error
404
Post not found
Error
500
Error processing request
Error
Security Schema
Scopes
cookieAuth
Upvotes as authenticated user. Acts as an unvote if user has already upvoted, and removes downvote if applicable.
Name
Located in
Description
Required
Schema
id
required
ID of post to upvote
No
string
Code
Description
Schema
200
The post score along with user's new vote_status for the post
Vote
403
Error
404
Post not found
Error
500
Error processing request
Error
Security Schema
Scopes
cookieAuth
Paginates through a feed of posts around the specified coordinates
Name
Located in
Description
Required
Schema
lat
query
Current latitude cooridnate of user
Yes
float
lon
query
Current longitude cooridnate of user
Yes
float
radius
query
Distance radius to find posts within
Yes
number
unit
query
Unit for distance radius option (enum: mi,km)
Yes
string
sort_by
query
Determines whether to sort by popularity, distance, or just by date (enum: popular, proximity, date)
No
string
page
query
Current page of feed to request (defaults to 1)
No
integer
limit
query
Number of posts to retrieve per page (defaults to 10)
No
integer
Code
Description
Schema
200
Resulting page of feed
[ Post.model ]
400
Missing required parameters
Error
500
Unable to request feed (backend error)
Error
Security Schema
Scopes
cookieAuth
Retrieves all posts created by the reqesting user (pagination optional)
Name
Located in
Description
Required
Schema
page
get
Page number for pagination
No
integer
limit
get
Number of entries sent per page
No
integer
Code
Description
Schema
200
Resulting page of feed
[ Post.model ]
500
Unable to request feed (backend error)
Error
Security Schema
Scopes
cookieAuth
Name
Type
Description
Required
authenticated
boolean
True if user is authenticated. False otherwise
No
user
User
No
Name
Type
Description
Required
error
string
Error message Example: "Error message"
No
Name
Type
Description
Required
coordinates
Array
Longitude and Latitude of Location Example: "[-120.24, 39.21]"
Yes
type
string
Type of GeoJSON location Enum: "Point"
Yes
Name
Type
Description
Required
content
string
Raw image data of drawing (base64)
Yes
created_at
string
Date created Example: "2020-10-06 15:25:58.542Z"
No
distance
float
Distance to user (only provided if querying from feed) Example: "41.2"
No
distance_unit
string
Unit for the distance field (only provided if querying from feed) Example: "mi"
No
id
string
ID of the post Example: "5d7d52e543be22485d393712"
Yes
lat
float
Latitude coordinate where post was created Example: "-71.8081"
Yes
lon
float
Longitude coordinate where post was created Example: "42.2743"
Yes
owned
boolean
True if post belongs to the requesting user
No
score
integer
Net score of upvotes and downvotes
Yes
updated_at
string
Date last updated Example: "2020-10-06 19:50:14.217Z"
No
vote_status
string
Vote status for user making call (unvoted/upvoted/downvoted) Enum: "0", "1", "2"
No
Name
Type
Description
Required
created_at
string
Date created Example: "2020-10-06 15:25:58.542Z"
Yes
email
string
Email Address (gmail) Example: "kotlin4lyfe@gmail.com"
Yes
google_id
string
ID of corresponding Google Account
Yes
id
string
ID for the user Example: "5f824707c871eb58cd61740a"
Yes
name
string
Full name of user Example: "John Doe"
Yes
profile_url
string
URL to profile picture of corresponding Google Account
No
updated_at
string
Date last updated Example: "2020-10-06 19:50:14.217Z"
Yes
Name
Type
Description
Required
score
integer
The current net between upvotes and downvotes on corresponding post
Yes
vote_status
string
The vote status for the requesting user on corresponding post (unvoted/upvoted/downvoted) Enum: "0", "1", "2"
Yes