Ugly Things API Documentation

The Ugly Things API is something we built to help students create web applications with a completely open API to use. Have fun! And don't get too crazy on it...

The baseUrl is: https://api.vschool.io/<yourname>/thing[/<thingId>]

(Where <yourname> is your actual name, i.e.: https://api.vschool.io/jonsmith/thing) and <thingId> is the _id attribute of an already-existing thing item. (Only to be used for GET (one), PUT, and DELETE requests.) See the Using id section below for more info on how to use _id in your requests.

All thing items are tracked by your name so don't forget to enter it in the url.

GET requests

GET all things: https://api.vschool.io/<yourname>/thing

GET one thing: https://api.vschool.io/<yourname>/thing/<todoId>

POST requests

POST a new thing: https://api.vschool.io/<yourname>/thing

PUT requests

Update (PUT) an existing thing: https://api.vschool.io/<yourname>/thing/<thingId>

DELETE requests

DELETE an existing thing: https://api.vschool.io/<yourname>/thing/<thingId>


The database model looks like this:
Note: You won't need to mess with sessionId - that is handled automatically

{
    title: {
        type: String,
        required: true
    },
    description: {
    	type: String,
        required: true
    },
    imgUrl: {
    	type: String,
        required: true
    },
    sessionId: {
        type: String,
        required: true
    }
}

Don't worry if that doesn't look familiar to you yet. All it means is that you can submit a JavaScript object that looks like this (notice that the all of the properties MUST be included in your object in order to work, the sessionId will be added automatically, you do not need to add that yourself):

var newThing = {
    title: "Title here",
    description: "Description here",
    imgUrl: "http://www.example.com/some-link-to-a-cool-photo.jpg"
};

Any properties you submit to the server that aren't title, description, or imgUrl will be ignored, so make sure you're spelling everything exactly right.