GET all memes
GET
http://alpha-meme-maker.herokuapp.com/:page
Gets top 24 results, page wise. Returns the next URL as a token.
Sample input
curl -X GET http://alpha-meme-maker.herokuapp.com/
curl -X GET http://alpha-meme-maker.herokuapp.com/1
Sample output
{
"code": 200,
"data": [
{
"ID": 1,
"bottomText": "Good!",
"image": "http://imgflip.com/s/meme/Grumpy-Cat.jpg",
"name": "Grumpy Cat",
"tags": "Tardar Sauce, Tabatha Bundesen, Felis domesticus",
"topText": ""
},
...
{
"ID": 24,
"bottomText": "",
"image": "https://imgflip.com/s/meme/Good-Guy-Greg.jpg",
"name": "Good Guy Greg",
"tags": "ggg",
"topText": " "
}
],
"message": "GET successful",
"next": "http://alpha-meme-maker.herokuapp.com/2"
}
POST a new meme
POST
http://alpha-meme-maker.herokuapp.com/add/
Adds a new meme to the database. Requires header authentication.
Headers (HTTP Headers) | Required |
postSecret | Yep |
adminPassword | Yep |
Parameters (HTTP Body) | Value | Required |
name | Name (must be unique) | Yep |
tags | Additional tags for searching | Yep |
image | URL of the image | Yep |
topText | Default top text | Nope |
bottomText | Default bottom text | Nope |
detail | Information/history | Nope |
thumb | Optional thumbnail image | Nope |
rank | Ranking based on popularity | Nope |
Sample input
curl -X POST http://alpha-meme-maker.herokuapp.com/add/ -H "postSecret=???" -H "adminPassword=???" -F "name=???" -F "tags=???" -F "image=???" -F "topText=???" -F "bottomText=???"
Sample output
{
"code": 200,
"data": [],
"message": "POST successful"
}
GET particular meme
GET
http://alpha-meme-maker.herokuapp.com/memes/:id
Gets details of one particular meme, based on the meme ID.
Sample input
curl -X GET http://alpha-meme-maker.herokuapp.com/memes/13
Sample output
{
"code": 200,
"data": {
"ID": 13,
"bottomText": "But when I do ___",
"detail": "The Most Interesting Man In The World is an image macro series based...",
"image": "https://imgflip.com/s/meme/The-Most-Interesting-Man-In-The-World.jpg",
"name": "The Most Interesting Man in the World",
"submissions": [
{
"bottomText": "But when I do, I just log them",
"dateCreated": "2016-04-02 23:24:05",
"topText": "I don't always handle exceptions"
}
],
"tags": "Jonathan Goldsmith",
"thumb": "",
"topText": "I don't always ___"
},
"message": "GET Success"
}
UPDATE an existing meme
PUT
http://alpha-meme-maker.herokuapp.com/memes/:id
Updates an existing meme in the database. Requires header authentication.
Headers (HTTP Headers) | Required |
putSecret | Yep |
adminPassword | Yep |
Parameters (HTTP Body) | Value |
tags | Additional tags for searching |
image | URL of the image |
topText | Default top text |
bottomText | Default bottom text |
detail | Information/history |
thumb | Optional thumbnail image |
rank | Ranking based on popularity |
Sample input
curl -X PUT http://alpha-meme-maker.herokuapp.com/memes/5 -H "putSecret=???" -H "adminPassword=???" -F "topText=???" -F "bottomText=???"
Sample output
{
"code": 200,
"data": [],
"message": "PUT successful"
}
GET submissions
GET
http://alpha-meme-maker.herokuapp.com/submissions
Gets the latest 24 submissions, page wise. Returns the next URL as a token.
GET
http://alpha-meme-maker.herokuapp.com/memes/:memeID/submissions
Gets all the submissions for the given meme ID.
Sample input
curl -X GET http://alpha-meme-maker.herokuapp.com/submissions
Sample output
{
"code": 200,
"data": [
{
"bottomText": "You must know everything",
"dateCreated": "2016-04-03 00:18:43",
"memeID": 14,
"topText": "Oh you just graduated"
},
...
{
"bottomText": "Season 6 is coming",
"dateCreated": "2016-04-02 12:16:43",
"memeID": 7,
"topText": "Brace Yourselves"
}
],
"message": "GET successful",
"next": "http://alpha-meme-maker.herokuapp.com/submissions/2"
}
Sample input
curl -X GET http://alpha-meme-maker.herokuapp.com/memes/13/submissions
Sample output
{
"code": 200,
"data": [
{
"bottomText": "But when I do, I just log them",
"dateCreated": "2016-04-02 23:24:05",
"topText": "I don't always handle exceptions"
}
],
"message": "GET Submissions Success"
}
POST a new submission
POST
http://alpha-meme-maker.herokuapp.com/submissions
Adds a new submission (requires meme ID to be passed as a HTTP body paramater)
POST
http://alpha-meme-maker.herokuapp.com/memes/:memeID/submissions
Adds a new submission for the particular meme ID.
Parameters (HTTP Body) | Required |
memeID | Yep (When using the first URL) |
topText | Maybe |
bottomText | Maybe |
|
Note: One of topText or bottomText is required. |
Sample input
curl -X POST http://alpha-meme-maker.herokuapp.com/submissions -F "topText=???" -F "bottomText=???"
curl -X POST http://alpha-meme-maker.herokuapp.com/memes/6/submissions -F "topText=???" -F "bottomText=???"
Sample output
{
"code": 200,
"data": [],
"message": "POST Submission Success"
}