Post Create API - Merevoli-DatLuu/SocialNetworkAPI GitHub Wiki
post/ - Thêm một bài post mới
/api/v1/post/
HTTP/1.1 POST - Permission:
everyone
- Require Logged In:
true
- Require Verified User:
true
Parameter:
Field | Method | Type | Description | Required |
---|---|---|---|---|
title | POST | string | Tiêu đề bài post | |
content | POST | string | Nội dung bài post | * |
mode | POST | string | Chế độ bài post | lựa chọn ("PUBLIC", "PRIVATE"), mặc định là "PUBLIC" |
Success 200:
Field | Type | Description |
---|---|---|
status | string | Trạng thái |
message | string | Thông báo chi tiết |
data | json | Thông tin bài post vừa tạo |
Example:
Request
POST http://127.0.0.1:8000/api/v1/post HTTP/1.1
content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjI2NzA2Njg4LCJqdGkiOiJjNDNlYWZjNjFjNzM0YTYxODBiMmJlODYxMDU5OGFlMSIsInVzZXJfaWQiOjIwfQ.qeMpHbZm6tdMA6QrJmP6Az8fkHtsbb5r-p-Ond5jWoM
{
"title": "Title 1",
"content": "this is post 1",
"mode": "PRIVATE"
}
Response data