-
Notifications
You must be signed in to change notification settings - Fork 2
Street Art Orlando API Documentation
Staging: https://sao-api-staging.herokuapp.com/api
Production: https://sao-api.herokuapp.com/api
Accept = application/json
Content-Type = application/json
Authorization = [AUTH_TOKEN] // Used in Authenticated Endpoints
Register new user.
POST /users/register
-
name
- Name String (optional) -
email
- Valid Email String (required) -
password
- Password String (required)
Response Code: 201
{ "success": true }
User login.
POST /authenticate
-
email
- Email String (required) -
password
- Password String (required)
Response Code: 200
{
"auth_token": "auth_token_string"
}
Change user password while user is authenticated.
Authenticated: true
PUT /password/update
-
password
- Password (required)
Used to reset a user's password if forgotten. This flow works when the user is not authenticated. Sends an email to the user with 6 digit validation code.
POST /password/forgot
-
email
- User's email (required)
Response Code: 200
{
"success": true,
"message": "A security code will be sent to you via email shortly."
}
Validates 6 digit code that was received by email. Code expires in 4 hours.
POST /password/vaidate_token
-
email
- User's email (required) -
token
- Validation Token (required)
Response Code: 200
{ "success": true }
Allows user to create a password after validating the 6 digit code.
POST /password/reset
-
email
- User's email (required) -
token
- Validation Token (required) -
password
- New Passwork (required)
Response Code: 200
{ "success": true }
Fetch all submissions available (sorted by latest first). Does not require authentication. This endpoint is paginated.
GET /submissions
-
page
- Page Number (i.e. 1,2,3); Empty Responds First Page
Response Code: 200
{
"submissions": [
{
"id": 1,
"status": "approved",
"title": "Title String (Optional)",
"description": "Description Text (Optional)",
"photo_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/display_photo.jpeg",
"thumb_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/thumb_photo.jpeg",
"tiny_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/tiny_photo.jpeg",
"artist": "Artist Name (Optional)",
"location_note": "Location Note (Optional)",
"created_at": "2018-09-05T16:07:37.760Z",
"favorite": false,
"latitude": 18.34008,
"longitude": -66.099282
}
],
"meta": {
"current_page": 1,
"next_page": null,
"total": 1,
"total_pages": 1
}
}
Upload a submission to the API backend server. Content is moderated for non VIP users.
Authenticated: true
POST /submissions
-
photo
- Image in Base64 String Format (required) -
title
- Title String (optional) -
artist
- Artist String (optional) -
location_note
- Location Note String (optional) -
latitude
- Latitude Decimal (required) -
longitude
- Longitude Decimal (required)
Status Code: 202
{ "success": true }
Fetch submissions that belong to the current user. This endpoint is not paginated and may only respond with a partial list of submissions.
Authenticated: true
GET /submissions/mine
Response Code: 200
{
"submissions": [
{
"id": 1,
"status": "approved",
"title": "Title String (Optional)",
"description": "Description Text (Optional)",
"photo_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/display_photo.jpeg",
"thumb_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/thumb_photo.jpeg",
"tiny_url": "https://street-art-orlando-images-staging.s3.amazonaws.com/uploads/submission/photo/1/tiny_photo.jpeg",
"artist": "Artist Name (Optional)",
"location_note": "Location Note (Optional)",
"created_at": "2018-09-05T16:07:37.760Z",
"favorite": false,
"latitude": 18.34008,
"longitude": -66.099282
}
]
}
Fetch all favorites that belong to a user. Not paginated.
Authenticated: true
GET /submissions/favorites
Response Code: 200
{
"submissions": [
{
"id": 12,
"status": "approved",
"title": "This is a Title",
"description": "",
"photo_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/12/display_20180829_134348.jpg",
"thumb_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/12/thumb_20180829_134348.jpg",
"tiny_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/12/tiny_20180829_134348.jpg",
"artist": "Artist Wow",
"location_note": "Next to 7 Eleven",
"created_at": "2018-08-29T02:31:30.923Z",
"favorite": true,
"latitude": 28.55181,
"longitude": -81.37978
},
{
"id": 2,
"status": "approved",
"title": "Stardust Planet",
"description": "",
"photo_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/2/display_photo.jpeg",
"thumb_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/2/thumb_photo.jpeg",
"tiny_url": "https://street-art-orlando-images-dev.s3.amazonaws.com/uploads/submission/photo/2/tiny_photo.jpeg",
"artist": "",
"location_note": "",
"created_at": "2018-07-28T22:02:50.799Z",
"favorite": true,
"latitude": 28.568397,
"longitude": -81.346375
}
]
}
Favorite Submission.
Authenticated: true
POST /submissions/:id/favorite
-
id
- Submission ID
Response Code: 204
No Content
Unfavorite Submission.
Authenticated: true
DELETE /submissions/:id/unfavorite
-
id
- Submission ID
Response Code: 204
No Content
- Errors may be client side
4xx
or server side5xx
.
Client side errors may in some cases include a payload with messages that can be displayed to the user in an alert.
{
"error": "Error Message"
}
{
"errors": [
"Error Message 1",
"Error Message 2"
]
}