Go-tin is new, one of a kind social network developed as a project for FMI course Clean Code in 2019.
The project is currently in active development, for up-to-date status you can visit the dev
branch.
POST /v1/users
{
"username": "test_user",
"password": "a"
}
Status Code | Description |
---|---|
201 Created | Will be returned if the user is successfully registered. |
400 Bad Request | Will be returned if the request is malformed or missing mandatory data. |
GET /users/{username}
Status Code | Description |
---|---|
200 OK | Will be returned if the user is found. Expected body is below. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | Will be returned if the user does not exist. |
{
"username": "test_user",
"birth_date": "1997-12-12",
"bio": "test bio",
"hometown": "test town"
}
PUT /follow/{username}
Status Code | Description |
---|---|
201 Created | Will be returned if the relation is created. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | Will be returned if the user does not exist. |
DELETE /follow/{username}
Status Code | Description |
---|---|
204 No Content | Will be returned if the relation is deleted. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | Will be returned if the user does not exist. |
GET /followers
Status Code | Description |
---|---|
200 OK | MUST be returned upon successful processing of this request. The expected response body is below. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | MUST be returned when the current user does not have followers. |
The response body MUST be a valid JSON Object ({}
).
[
{
"username": "test_user2",
"birth_date": "2000-07-02",
"bio": "some bio",
"hometown": "Burgas"
},
{
"username": "test_user3",
"birth_date": "1997-09-04",
"bio": "some bio2",
"hometown": "Sofia"
}
]
GET /following
Status Code | Description |
---|---|
200 OK | The expected response body is below. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | Will be returned when the current user does not follow anyone. |
The response body MUST be a valid JSON Object ({}
).
[
{
"username": "test_user3",
"birth_date": "2000-07-02",
"bio": "some bio",
"hometown": "Burgas"
},
{
"username": "test_user4",
"birth_date": "1997-09-04",
"bio": "some bio2",
"hometown": "Sofia"
}
]
POST /v1/posts
The request body MUST be a valid JSON Object ({}
).
{
"title": "title",
"content": "content"
}
Status Code | Description |
---|---|
201 Created | The resource is created |
401 Unauthorized | Will be returned if authentication fails. |
400 Bad Request | Will be returned if the request body is invalid. |
GET /v1/posts
Status Code | Description |
---|---|
200 OK | MUST be returned upon successful processing of this request. The expected response body is below. |
401 Unauthorized | Will be returned if authentication fails. |
404 Not Found | MUST be returned when no post are presented. |
The response body MUST be a valid JSON Object ({}
).
[
{
"title": "title",
"content": "content",
"date": "2019-07-02T00:00:00Z"
},
{
"title": "title2",
"content": "content2",
"date": "2019-07-02T00:00:00Z"
}
]