Skip to content

Street Art Orlando API Documentation

Axel Rivera edited this page Sep 5, 2018 · 5 revisions

Base URL

Staging: https://sao-api-staging.herokuapp.com/api
Production: https://sao-api.herokuapp.com/api

Default Headers

Accept = application/json
Content-Type = application/json
Authorization = [AUTH_TOKEN] // Used in Authenticated Endpoints

Registration

POST /users/register

Parameters (Body)

{
  "name": "Test User (Optional)",
  "email": "[email protected]",
  "password": "password"
}

Response

Response Code: 201

{ "success": true }

Authentication

Login

POST /authenticate

Parameters (Body)

{
  "email": "[email protected]",
  "password: "password"
}

Response

Response Code: 200

{ "auth_token": "auth_token_string" }

Update Password

TODO

Password Reset

Forgot Password

TODO

Validate Password Token

TODO

Password Reset

TODO

Submissions

Fetch Submissions

GET /submissions

Parameters (URL)

  • page - Page Number (i.e. 1,2,3); Empty Responds First Page

Response

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 Submission

Authenticated: true

POST /submissions

Parameters (Body)

{
  "photo": "IMAGE IN BASE64 STRING FORMAT",
  "title": "Title String",
  "artist": "Artist Name",
  "location_note": "Location Note (i.e. Next to Drunken Monkey Coffee Shop)"
  "latitude": 12.345,
  "longitude": 12.345
}

Response

Status Code: 202

{ "success": true }

My Submissions

TODO

My Favorites

TODO

Add Favorite

TODO

Remove Favorite

TODO

Clone this wiki locally