NanoPost
Simple social network designed for learning
200
ResultResponse
Body
Object
result
boolean
required
Default:
true
Object
count
integer
required
total
integer
required
offset
string
nullable
items
Array
required
One of
GET
/api/auth/checkUsername
GET
/api/auth/login
POST
/api/auth/register
GET
/api/auth/checkUsername
Authentication
Open
Request parameters
username
string
required
Имя пользователя, используемое для авторизации
Min length:
3
Max length:
16
Pattern:
\w(?!.*?\.{2})[\w.]{1,14}\w
Example:
evo
Responses
200
OK
Body
Object
result
string
required
Enumeration:
TooShort
имя пользователя короче 3 символов
TooLong
имя пользователя длиннее 16 символов
InvalidCharacters
имя пользователя содержит неподдерживаемые символы (разрешены a
-z
,_
, .
)
Taken
имя пользователя занято
Free
имя пользователя свободно
GET
/api/auth/login
Authentication
Open
Request parameters
username
string
required
Имя пользователя, используемое для авторизации
Min length:
3
Max length:
16
Pattern:
\w(?!.*?\.{2})[\w.]{1,14}\w
Example:
evo
password
string
required
Пароль для учётной записи пользователя
Min length:
8
Example:
********
POST
/api/auth/register
Authentication
Open
Request body
Object
username
string
required
Имя поьзователя, используемое для авторизации
Min length:
3
Max length:
16
Pattern:
\w(?!.*?\.{2})[\w.]{1,14}\w
Example:
evo
password
string
required
Пароль для учётной записи пользователя
Min length:
8
Example:
********
200
TokenResponse
Body
Object
token
string
required
userId
string
required
GET
/api/v1/images/
{profileId}
PUT
/api/v1/image
GET
/api/v1/image/
{imageId}
DELETE
/api/v1/image/
{imageId}
GET
/api/v1/images/
{profileId}
Authentication
Open
Path variables
profileId
string
required
Examples:
evo4ceb5d23-6db1-4298-b766-705af2927b0f
Request parameters
count
integer
optional
Default:
30
offset
string
optional
Responses
200
OK
Body
Object
PUT
/api/v1/image
Authentication
Bearer
Request body
multipart/form-data
Object
image
string
binary
required
Responses
200
OK
Body
GET
/api/v1/image/
{imageId}
Authentication
Open
Path variables
imageId
string
required
Responses
200
OK
Body
Object
id
string
required
owner
ProfileCompact
required
dateCreated
integer
required
Время создания картинки в миллисекундах (long)
sizes
GET
/api/v1/profile/search
GET
/api/v1/profile/
{profileId}
PATCH
/api/v1/profile/
{profileId}
PUT
/api/v1/profile/
{profileId}
/subscribe
DELETE
/api/v1/profile/
{profileId}
/subscribe
PUT
/api/v1/profile/pushToken
DELETE
/api/v1/profile/pushToken
GET
/api/v1/profile/search
Authentication
Open
Request parameters
query
string
required
Поисковый запрос
count
integer
optional
Default:
30
offset
string
optional
Responses
200
OK
Body
Object
count
integer
required
total
integer
required
offset
string
nullable
items
GET
/api/v1/profile/
{profileId}
Authentication
Open
Path variables
profileId
string
optional
Examples:
evo4ceb5d23-6db1-4298-b766-705af2927b0f
Responses
200
OK
Body
Object
id
string
required
username
string
required
displayName
string
nullable
bio
string
nullable
avatarId
string
nullable
avatarSmall
string
nullable
avatarLarge
string
nullable
subscribed
boolean
required
subscribersCount
integer
required
postsCount
integer
required
imagesCount
integer
required
images
Max items:
4
GET
/api/v1/feed
GET
/api/v1/posts/
{profileId}
PUT
/api/v1/post
GET
/api/v1/post/
{postId}
DELETE
/api/v1/post/
{postId}
GET
/api/v1/feed
Authentication
Bearer
Request parameters
count
integer
optional
Default:
30
offset
string
optional
Responses
200
OK
Body
Object
GET
/api/v1/posts/
{profileId}
Authentication
Open
Path variables
profileId
string
optional
Examples:
evo4ceb5d23-6db1-4298-b766-705af2927b0f
Request parameters
count
integer
optional
Default:
30
offset
string
optional
Responses
200
OK
Body
Object
PUT
/api/v1/post
Authentication
Bearer
Request body
multipart/form-data
Object
text
string
nullable
image1
string
binary
nullable
image2
string
binary
nullable
image3
string
binary
nullable
image4
string
binary
nullable
Responses
200
OK
Body
GET
/api/v1/post/
{postId}
Authentication
Open
Path variables
postId
string
required
Responses
200
OK
Body
Object
id
string
required
owner
ProfileCompact
required
dateCreated
integer
required
Время создания поста в миллисекундах (long)
text
string
nullable
images
likes
Object
required
liked
boolean
required
likesCount
integer
required