{info} Mengolah data postingan.
https://public-api.delcom.org/api/v1
/posts
Content-Type
: multipart/form-data
Authorization
: Bearer <token>
cover
as file
description
as string
{
"success": true,
"message": "Berhasil menambahkan data",
"data": {
"post_id": 6
}
}
/posts/:id/cover
Content-Type
: multipart/form-data
Authorization
: Bearer <token>
cover
as file
{
"success": true,
"message": "Berhasil mengubah cover"
}
/posts/:id
Content-Type
: application/x-www-form-urlencoded
Authorization
: Bearer <token>
description
as string
{
"success": true,
"message": "Berhasil mengubah data"
}
/posts
is_me
as 1
1
as retrieve all data created
Authorization
: Bearer <token>
{
"success": true,
"message": "Berhasil mengambil data",
"data": {
"posts": [
{
"id": 4,
"user_id": 1,
"cover": "http://127.0.0.1:8000/img/posts/cover/1_1728097631.jpeg",
"description": "Terus belajar apapun rintangannya!",
"created_at": "2024-10-05T03:07:11.000000Z",
"updated_at": "2024-10-05T03:07:11.000000Z",
"author": {
"name": "Delcom Testing",
"photo": null
},
"likes": [],
"comments": []
},
{
"id": 5,
"user_id": 1,
"cover": "http://127.0.0.1:8000/img/posts/cover/1_1728097665.jpeg",
"description": "Tolak ukur kemampuan adalah usaha...",
"created_at": "2024-10-05T03:07:45.000000Z",
"updated_at": "2024-10-05T03:07:45.000000Z",
"author": {
"name": "Delcom Testing",
"photo": null
},
"likes": [2, 3],
"comments": [3]
},
{
"id": 6,
"user_id": 3,
"cover": "http://127.0.0.1:8000/img/posts/cover/3_1728101053.jpeg",
"description": "Deskripsi telah berubah",
"created_at": "2024-10-05T04:02:12.000000Z",
"updated_at": "2024-10-05T04:05:05.000000Z",
"author": {
"name": "Abdullah Ubaid",
"photo": null
},
"likes": [1],
"comments": [1]
}
]
}
}
/posts/:id
Authorization
: Bearer <token>
{
"success": true,
"message": "Berhasil mengambil data",
"data": {
"post": {
"id": 5,
"user_id": 1,
"cover": "http://127.0.0.1:8000/img/posts/cover/1_1728097665.jpeg",
"description": "Tolak ukur kemampuan adalah usaha...",
"created_at": "2024-10-05T03:07:45.000000Z",
"updated_at": "2024-10-05T03:07:45.000000Z",
"author": {
"name": "Delcom Testing",
"photo": null
},
"likes": [2, 3],
"comments": [
{
"id": 2,
"comment": "Wah keren yah!",
"created_at": "2024-10-05T03:49:59.000000Z",
"updated_at": "2024-10-05T03:49:59.000000Z"
}
],
"my_comment": {
"id": 2,
"comment": "Wah keren yah!",
"created_at": "2024-10-05T03:49:59.000000Z",
"updated_at": "2024-10-05T03:49:59.000000Z"
}
}
}
}
/posts/:id
Authorization
: Bearer <token>
{
"success": true,
"message": "Berhasil menghapus data"
}
/posts/:id/likes
Content-Type
: application/x-www-form-urlencoded
Authorization
: Bearer <token>
like
as 1 | 0
1
as give like
0
as delete like
{
"success": true,
"message": "Berhasil mengubah status suka pada postingan"
}
/posts/:id/comments
Content-Type
: application/x-www-form-urlencoded
Authorization
: Bearer <token>
comment
as string
{
"success": true,
"message": "Berhasil memberikan komentar pada postingan"
}
/posts/:id/comments
Authorization
: Bearer <token>
{
"success": true,
"message": "Berhasil menghapus komentar pada postingan"
}