Api Specification for Youthpedia consist users, webinars, categories, comments and artikels entity. Link updated API Documentation : https://documenter.getpostman.com/view/15798551/UVRDHm6X Link upload Heroku : https://projectbackend13.herokuapp.com/
Request :
- Method : POST
- Endpoint :
/api/users/register
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"username": "jose3",
"email": "[email protected]",
"password": "12345678",
"role":"user",
"country": "indonesia"
}
Response :
{
"message": "Success",
"data": {
"username": "jose3",
"email": "[email protected]",
"date": "2021-12-24T11:11:10.952Z",
"role": "user",
"country": "indonesia",
"id": "61c5b12ed72ad899c3314e2e"
}
}
Request :
- Method : POST
- Endpoint :
/api/users/login
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"username": "jose",
"password": "12345678"
}
Response :
json
{
"message": "Success",
"data": {
"username": "jose",
"email": "[email protected]",
"date": "2021-12-24T09:34:51.252Z",
"role": "user",
"country": "indonesia",
"id": "61c598ef645dd43484d68f28",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiam9zZSIsImlhdCI6MTY0MDMzOTcwMiwiZXhwIjoxNjQwNDI2MTAyfQ.mu-NjGeeIrIPoE2NBd2YDdTVB-yZlL2e5ldS0YlOV6w"
}
}
Request :
- Method : GET
- Endpoint :
/api/users/user-Profile
- Header :
- Authorization: Acces Token
Response :
{
"message": "Authorized User!!"
}
Request :
- Method : POST
- Endpoint :
/api/webinar/post
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"judul": "Summerfest",
"deskripsi": "Summerfest merupakan festival musik terbesar di Amerika Serikat. Berlangsung selama 11 hari, Summerfest dihadiri lebih dari 800 ribu pentonton pada 2016 lalu. Meski demikian, harga tiket Summerfest terbilang cukup murah, yakni hanya 20 dollar, atau sekitar Rp 280 ribu.",
"gambar": "https://images.unsplash.com/photo-1633289692767-7b7b990005ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8c3VtbWVyZmVzdHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=500&q=60",
"countries": "Indonesia"
}
Response :
{
"judul": "Summerfest",
"deskripsi": "Summerfest merupakan festival musik terbesar di Amerika Serikat. Berlangsung selama 11 hari, Summerfest dihadiri lebih dari 800 ribu pentonton pada 2016 lalu. Meski demikian, harga tiket Summerfest terbilang cukup murah, yakni hanya 20 dollar, atau sekitar Rp 280 ribu.",
"gambar": "https://images.unsplash.com/photo-1633289692767-7b7b990005ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8c3VtbWVyZmVzdHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=500&q=60",
"countries": "Indonesia",
"_id": "61c5960d645dd43484d68f02",
"__v": 0
}
Request :
- Method : GET
- Endpoint :
/api/webinar/get
- Header :
- Authorization: Acces Token
Response :
{
"_id": "61c59529645dd43484d68ef9",
"judul": "SummerFest",
"deskripsi": "Summerfest merupakan festival musik terbesar di Amerika Serikat. Berlangsung selama 11 hari, Summerfest dihadiri lebih dari 800 ribu pentonton pada 2016 lalu. Meski demikian, harga tiket Summerfest terbilang cukup murah, yakni hanya 20 dollar, atau sekitar Rp 280 ribu.",
"gambar": "https://images.unsplash.com/photo-1633289692767-7b7b990005ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8c3VtbWVyZmVzdHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=500&q=60",
"countries": "Indonesia",
"__v": 0
}
Request :
- Method : PUT
- Endpoint :
/api/webinar/put
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"judul": "SummerFest",
"deskripsi": "Summerfest merupakan festival musik terbesar di Amerika Serikat. Berlangsung selama 11 hari, Summerfest dihadiri lebih dari 800 ribu pentonton pada 2016 lalu. Meski demikian, harga tiket Summerfest terbilang cukup murah, yakni hanya 20 dollar, atau sekitar Rp 280 ribu.",
"gambar": "https://images.unsplash.com/photo-1633289692767-7b7b990005ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8c3VtbWVyZmVzdHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=500&q=60",
"countries": "Indonesia"
}
Response :
{
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}
Request :
- Method : GET
- Endpoint :
/api/webinar/get/:id
- Header :
- Authorization: Acces Token
Response :
{
"_id": "61c59529645dd43484d68ef9",
"judul": "SummerFest",
"deskripsi": "Summerfest merupakan festival musik terbesar di Amerika Serikat. Berlangsung selama 11 hari, Summerfest dihadiri lebih dari 800 ribu pentonton pada 2016 lalu. Meski demikian, harga tiket Summerfest terbilang cukup murah, yakni hanya 20 dollar, atau sekitar Rp 280 ribu.",
"gambar": "https://images.unsplash.com/photo-1633289692767-7b7b990005ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8c3VtbWVyZmVzdHxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=500&q=60",
"countries": "Indonesia",
"__v": 0
}
Request :
- Method : DELETE
- Endpoint :
/api/webinar/delete/:id
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
{
"deletedCount": 1
}
Request :
- Method : POST
- Endpoint :
/api/category/post
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"category":"Crime"
}
Response :
{
"category": "Crime",
"_id": "61c5986a645dd43484d68f1e",
"__v": 0
}
Request :
- Method : GET
- Endpoint :
/api/category/get
- Header :
- Authorization: Acces Token
Response :
{
"_id": "61c5986a645dd43484d68f1e",
"category": "Crime",
"__v": 0
}
Request :
- Method : PUT
- Endpoint :
/api/category/:id
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"category":"Crime"
}
Response :
{
"acknowledged": true,
"modifiedCount": 0,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}
Request :
- Method : DELETE
- Endpoint :
/api/category/:id
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
{
"deletedCount": 1
}
Request :
- Method : POST
- Endpoint :
/api/comment/post
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"comment":"Good",
"user": "61c598ef645dd43484d68f28"
}
Response :
{
"comment": [
"Good"
],
"user": "61c598ef645dd43484d68f28",
"_id": "61c59927645dd43484d68f2d",
"__v": 0
}
Request :
- Method : GET
- Endpoint :
/api/comment/get
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
[
{
"_id": "61c5977d645dd43484d68f12",
"comment": [
"Good"
],
"user": {
"username": "admin",
"email": "[email protected]",
"date": "2021-12-24T09:34:51.252Z",
"role": "admin",
"country": "indonesia",
"id": "61c59462645dd43484d68ef2"
},
"__v": 0
},
{
"_id": "61c59927645dd43484d68f2d",
"comment": [
"Good"
],
"user": {
"username": "jose",
"email": "[email protected]",
"date": "2021-12-24T09:34:51.252Z",
"role": "user",
"country": "indonesia",
"id": "61c598ef645dd43484d68f28"
},
"__v": 0
}
]
Request :
- Method : PUT
- Endpoint :
/api/comment/put/:id
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"comment":"Good Job",
"user": "61c598ef645dd43484d68f28"
}
Response :
{
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}
Request :
- Method : DELETE
- Endpoint :
/api/comment/delete/:id
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
{
"deletedCount": 1
}
Request :
- Method : POST
- Endpoint :
/api/artikel/post
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"countries":"Indonesia",
"category":"61c5985b645dd43484d68f18",
"title":"10 Universitas Ini Paling Indah Sedunia, Nomor Satu di Mana Ya?",
"deskripsi":"Banyak universitas di dunia ini yang memiliki bangunan terkenal indah. Sehingga, tidak jarang mereka dijadikan lokasi pengambilan gambar sebuah film ataupun bahkan drama Korea, sebut saja Yonsei University.Tetapi, dari banyaknya kampus indah tersebut, ada beberapa di antaranya yang dikenal paling estetik. Kampus apa saja yang dimaksud?",
"picture":"https://akcdn.detik.net.id/community/media/visual/2021/07/12/heidelberg-university-salah-satu-universitas-terindah-di-dunia-dok-heidelberg-uni.jpeg?w=700&q=90",
"source":"https://www.detik.com/edu/perguruan-tinggi/d-5861530/10-universitas-ini-paling-indah-sedunia-nomor-satu-di-mana-ya",
"comment": "61c59927645dd43484d68f2d",
"trend": true,
"recomended":false
}
Response :
{
"countries": "Indonesia",
"category": "61c5985b645dd43484d68f18",
"title": "10 Universitas Ini Paling Indah Sedunia, Nomor Satu di Mana Ya?",
"deskripsi": "Banyak universitas di dunia ini yang memiliki bangunan terkenal indah. Sehingga, tidak jarang mereka dijadikan lokasi pengambilan gambar sebuah film ataupun bahkan drama Korea, sebut saja Yonsei University.Tetapi, dari banyaknya kampus indah tersebut, ada beberapa di antaranya yang dikenal paling estetik. Kampus apa saja yang dimaksud?",
"picture": "https://akcdn.detik.net.id/community/media/visual/2021/07/12/heidelberg-university-salah-satu-universitas-terindah-di-dunia-dok-heidelberg-uni.jpeg?w=700&q=90",
"source": "https://www.detik.com/edu/perguruan-tinggi/d-5861530/10-universitas-ini-paling-indah-sedunia-nomor-satu-di-mana-ya",
"comment": "61c59927645dd43484d68f2d",
"trend": true,
"recomended": false,
"_id": "61c59976645dd43484d68f35",
"__v": 0
}
Request :
- Method : GET
- Endpoint :
/api/artikel/get
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
[
{
"_id": "61c59976645dd43484d68f35",
"countries": "Indonesia",
"category": {
"_id": "61c5985b645dd43484d68f18",
"category": "Education",
"__v": 0
},
"title": "10 Universitas Ini Paling Indah Sedunia, Nomor Satu di Mana Ya?",
"deskripsi": "Banyak universitas di dunia ini yang memiliki bangunan terkenal indah. Sehingga, tidak jarang mereka dijadikan lokasi pengambilan gambar sebuah film ataupun bahkan drama Korea, sebut saja Yonsei University.Tetapi, dari banyaknya kampus indah tersebut, ada beberapa di antaranya yang dikenal paling estetik. Kampus apa saja yang dimaksud?",
"picture": "https://akcdn.detik.net.id/community/media/visual/2021/07/12/heidelberg-university-salah-satu-universitas-terindah-di-dunia-dok-heidelberg-uni.jpeg?w=700&q=90",
"source": "https://www.detik.com/edu/perguruan-tinggi/d-5861530/10-universitas-ini-paling-indah-sedunia-nomor-satu-di-mana-ya",
"comment": {
"_id": "61c59927645dd43484d68f2d",
"comment": [
"Good"
],
"user": "61c598ef645dd43484d68f28",
"__v": 0
},
"trend": true,
"recomended": false,
"__v": 0
}
]
Request :
- Method : PUT
- Endpoint :
/api/artikel/put/:id
- Header :
- Content-Type: application/json
- Accept: application/json
- Authorization: Acces Token
- Body :
{
"countries":"Indonesia",
"category":"61c55ba79a1af33d3ec1afb4",
"title":"10 Universitas Ini Paling Indah Sedunia, Nomor Satu di Mana Ya?",
"deskripsi":"Banyak universitas di dunia ini yang memiliki bangunan terkenal indah. Sehingga, tidak jarang mereka dijadikan lokasi pengambilan gambar sebuah film ataupun bahkan drama Korea, sebut saja Yonsei University.Tetapi, dari banyaknya kampus indah tersebut, ada beberapa di antaranya yang dikenal paling estetik. Kampus apa saja yang dimaksud?",
"picture":"https://akcdn.detik.net.id/community/media/visual/2021/07/12/heidelberg-university-salah-satu-universitas-terindah-di-dunia-dok-heidelberg-uni.jpeg?w=700&q=90",
"source":"https://www.detik.com/edu/perguruan-tinggi/d-5861530/10-universitas-ini-paling-indah-sedunia-nomor-satu-di-mana-ya",
"comment": "61c5580fc538bc2de097f73f",
"trend": true,
"recomended":false
}
Response :
{
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}
Request :
- Method : DELETE
- Endpoint :
/api/artikel/delete/:id
- Header :
- Accept: application/json
- Authorization: Acces Token
Response :
{
"deletedCount": 1
}