Create a clone of Medium
POST users/login
Example request body:
{
"user":{
"email": "jack@email.com",
"password": "jackjack",
"name": "Jack Black"
}
}
No authentication required, returns a User
Required fields: email
, password
POST /api/users
Example request body:
{
"user":{
"username": "Jacob",
"email": "jake@jake.jake",
"password": "jakejake"
}
}
No authentication required, returns a User
Required fields: email
, username
, password
GET /api/user
Authentication required, returns a User that's the current user
PUT /api/user
Example request body:
{
"user":{
"email": "jake@jake.jake",
"bio": "I like to skateboard",
"image": "https://i.stack.imgur.com/xHWG8.jpg"
}
}
Authentication required, returns the User
Accepted fields: email
, username
, password
, image
, bio
GET /api/profiles/:username
Authentication optional, returns a Profile
POST /api/profiles/:username/follow
Authentication required, returns a Profile
No additional parameters required
DELETE users/:username/follow
Authentication required, returns a Profile
No additional parameters required
GET /articles
Returns most recent articles globally by default.
GET /articles
Can also take limit
and offset
query parameters like List Articles
Authentication required, will return multiple articles created by followed users, ordered by most recent first.
GET /articles/:id
No authentication required, will return single article
POST /articles
Example request body:
{
"article": {
"title": "How to train your dragon",
"description": "Ever wonder how?",
"body": "You have to believe",
"tagList": ["reactjs", "angularjs", "dragons"]
}
}
Authentication required, will return an Article
Required fields: title
, description
, body
Optional fields: tagList
as an array of Strings
PUT /api/articles/:id
Example request body:
{
"article": {
"title": "Did you train your dragon?"
}
}
Authentication required, returns the updated Article
Optional fields: title
, description
, body
The slug
also gets updated when the title
is changed
DELETE /articles/:id
Authentication required
POST /articles/:id/comments
Example request body:
{
"comment": {
"body": "His name was my name too."
}
}
Authentication required, returns the created Comment
Required field: body
GET /articles/:id/comments
Authentication optional, returns multiple comments
DELETE /articles/:id/comments/:id
Authentication required
POST /articles/:id/favorite
Authentication required, returns the Article
No additional parameters required
DELETE /articles/:id/favorite
Authentication required, returns the Article
No additional parameters required
GET /tags
No authentication required, returns a List of Tags