https://c23-gt01-01.et.r.appspot.com/
http://localhost:5000
POST /users
{
"username": string,
"email": string,
"image": string || null
"role": string,
"password": string,
"fullname": string,
}
{
"username": "user1",
"email": "user1@gmail.com",
"role": "user",
"password": "123user",
"fullname": "User Trackamte"
}
{
"error" : bool,
"status" : string,
"message": string,
"data" : {
"userId": string
}
}
{
"error": false,
"status": "success",
"message": "User berhasil ditambahkan",
"data": {
"userId": "user-I4YvO_qdU337HszX"
}
}
Login refers to get
access tokenandrefresh token
- Path
POST /authentications- Body Request
{ "username": string, "password": string, }- Example Body Request
{ "username": "user1", "password": "123user", }
{
"error" : bool
"status": string,
"message": string,
"data": {
"accessToken": string,
"refreshToken": string
}
}
{
"error" : false
"status": "success",
"message": "Login berhasil",
"data": {
"accessToken": "......PNCc3eAbhRycNDbc",
"refreshToken": "......_H5GczcpSr2HXk0"
}
}
POST /users/profile
Authorization: Bearer <access_token>
Content-Type: application/json
{
"error": bool,
"status": string,
"data": {
"user": {
"id": string,
"username": string,
"email": string,
"image": string || null,
"fullname": string
}
}
}
{
"error": false,
"status": "success",
"data": {
"user": {
"id": "user-a9vOKoZj3lfDar65",
"username": "user-1701908278",
"email": "user-1701908278@gmail.com",
"image": null, //will be null if not yet edited
"fullname": "User Trackamte"
}
}
}
PUT /users
Authorization: Bearer <access_token>
Content-Type: application/json
{
"username": string,
"email": string,
"image": string || null,
"fullname": string
}
{
"username": "user1 Edited",
"email": "user1edited@gmail.com",
"image": "http://image.com",
"fullname": "User Trackamte Edited"
}
{
"error": bool,
"status": string,
"message": string
}
{
"error": false,
"status": "success",
"message": "Profil berhasil diperbarui"
}
for security
access tokenwill be deleted in a short time, so use updaterefresh tokento get it again.
- Path
PUT /authentications- Body Request
{ "refreshToken": string }- Example Body Request
{ "refreshToken": "......hjudsmm8_%gsguysk" }
{
"error": bool,
"status": string,
"message": string,
"data": {
"accessToken": string
}
}
{
"error": false,
"status": "success",
"message": "Access Token berhasil diperbarui",
"data": {
"accessToken": "...............or2exHV-mtoARUYYuNub5YR4AoXA4"
}
}
Logout refers to delete
refreh token
- Path
DELETE /authentications- Body Request
{ "refreshToken": string }- Example Body Request
{ "refreshToken": "......hjudsmm8_%gsguysk" }
{
"error": bool,
"status": string,
"message": string
}
{
"error": false,
"status": "success",
"message": "Refresh token berhasil dihapus"
}
delete acount not delete refresh token, so please send request to
delete refresh tokenalso to logout after delete account
- Path
DELETE /users- Headers
Authorization: Bearer <access_token> Content-Type: application/json
{
"error": bool,
"status": string,
"message": string
}
{
"error": false,
"status": "success",
"message": "Akun berhasil dihapus"
}
GET /products
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error" : false,
"status" : "success",
"message" : "Menampilkan semua produk",
"count" : 3,
"data" : {
"products": [
{
"id": "product-3_PabLrYn6okMUwr",
"name": "Product 1",
"image": "https://picsum.photos/200",
"price": 10000,
"category": 1
},
{
"id": "product--4PQjQTklQLDLsB2",
"name": "Product 2",
"image": "https://picsum.photos/200",
"price": 30000,
"category": 2
},
{
"id": "product-IKqPltKAqIRWSNPw",
"name": "Product 3",
"image": "https://picsum.photos/200",
"price": 50000,
"category": 3
}
]
}
}
GET /recomendation
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error" : false,
"status" : "success",
"message" : "Menampilkan semua produk",
"count" : 3,
"data" : {
"recommended_products": [
{
"product_id": "B07YR26BJ3",
"product_name": "KENT 16052 Elegant Electric Glass Kettle 1.8L 2000 W | Blue LED Illumination | Borosilicate Glass Body | Boil Drying Protection | Used as Boiler | Milk | Tea | Water & Soup | 1 Year Warranty",
"rating_x": 4.0,
"product_link": "https://www.amazon.in/KENT-Elegant-Electric-Kettle-Silver/dp/B07YR26BJ3/ref=sr_1_29?qid=1672923592&s=kitchen&sr=1-29"
},
{
"product_id": "B09M3F4HGB",
"product_name": "Borosil Volcano 13 Fin Oil Filled Radiator Room Heater, 2900 W, Black",
"rating_x": 4.2,
"product_link": "https://www.amazon.in/Borosil-Volcano-Filled-Radiator-Heater/dp/B09M3F4HGB/ref=sr_1_371?qid=1672923611&s=kitchen&sr=1-371"
},
{
"product_id": "B09MFR93KS",
"product_name": "Bajaj Rex DLX 750 W 4 Jars Mixer Grinder, White and Blue",
"rating_x": 4.0,
"product_link": "https://www.amazon.in/Bajaj-Jars-Mixer-Grinder-White/dp/B09MFR93KS/ref=sr_1_447?qid=1672923614&s=kitchen&sr=1-447"
},
{
"product_id": "B018SJJ0GE",
"product_name": "Libra Roti Maker Electric Automatic | chapati Maker Electric Automatic | roti Maker Machine with 900 Watts for Making Roti/Chapati/Parathas - Stainless Steel",
"rating_x": 4.4,
"product_link": "https://www.amazon.in/Libra-Athena-Roti-Maker-Black/dp/B018SJJ0GE/ref=sr_1_455?qid=1672923614&s=kitchen&sr=1-455"
},
{
"product_id": "B07JGCGNDG",
"product_name": "Crompton Amica 15-L 5 Star Rated Storage Water Heater (Geyser) with Free Installation (White)",
"rating_x": 4.1,
"product_link": "https://www.amazon.in/Crompton-Greaves-ASWH-2015-15-Litre-Storage/dp/B07JGCGNDG/ref=sr_1_294_mod_primary_new?qid=1672923607&s=kitchen&sbo=RZvfv%2F%2FHxDF%2BO5021pAnSA%3D%3D&sr=1-294"
}
]
}
}
GET /products/search/:keyword
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error" : false,
"status" : "success",
"message" : "Menampilkan hasil pencarian untuk 'sambal' ",
"count" : 3,
"data" : {
"products": [
{
"id": "product-3_PabLrYn6okMUwr",
"name": "Sambal baby cumy",
"image": "https://picsum.photos/200",
"price": 10000,
"category": 1
},
{
"id": "product--4PQjQTklQLDLsB2",
"name": "Sambal goreng",
"image": "https://picsum.photos/200",
"price": 30000,
"category": 2
},
{
"id": "product-IKqPltKAqIRWSNPw",
"name": "Samabal teri",
"image": "https://picsum.photos/200",
"price": 50000,
"category": 3
}
]
}
}
GET /products/category/:id
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error" : false,
"status" : "success",
"message" : "Menampilkan semua produk",
"count" : 3,
"data" : {
"products": [
{
"id": "product-3_PabLrYn6okMUwr",
"name": "Product 1",
"image": "https://picsum.photos/200",
"price": 10000,
"category": 1
},
{
"id": "product--4PQjQTklQLDLsB2",
"name": "Product 2",
"image": "https://picsum.photos/200",
"price": 30000,
"category": 1
},
]
}
}
GET /products/:id
{
"error" : bool,
"status" : string,
"message" : string,
"data" : object,
}
{
"error" : false,
"status" : "success",
"data" : {
"product": {
"id": "product-IKqPltKAqIRWSNPw",
"name": "sambal khas",
"image": ["https://picsum.photos/200", "https://picsum.photos/200"] ,
"price": 50000,
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"resources": [
{
"name": "cabai",
"umkm": "Sukamaju",
"image": "https://picsum.photos/200",
"location": {
"lat": -34.397,
"lng": 150.644,
"name": "Wonogiri, Jawa Tengah",
},
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "batu",
"umkm": "Sukamaju",
"image": "https://picsum.photos/200",
"location": {
"lat" : -34.397,
"lng" : 150.644,
"name": "Wonogiri, Jawa Tengah",
},
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "batu",
"image": "https://picsum.photos/200",
"location": {
"lat": -34.397,
"lng": 150.644,
"name": "New York, US",
},
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}
],
"production": [
{
"name": "pengumpulan bahan baku",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "penumbukan",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "pengemasan",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}
],
"impact": [
{
"name": "Impact 1",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "Impact 2",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
},
{
"name": "Impact 3",
"image": "https://picsum.photos/200",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}
],
"contribution": [1,2,4],
"umkm": {
"id": "Umkm-VKDhH1FD3QbdzH6s",
"logo": "https://picsum.photos/200",
"name": "PT Sambal",
"location": {
"lat": -34.397,
"lng": 150.644,
"name": "Wonogiri, Jawa Tengah"
},
"employe": 1000
},
"category": 1,
"createdAt": "2023-11-22T06:58:51.120Z",
"updatedAt": "2023-11-22T06:58:51.120Z"
}
}
}
GET /products/umkm/:idumkm
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error" : false,
"status" : "success",
"message" : "Menampilkan semua produk umkm",
"count" : 2,
"data" : {
"products": [
{
"id": "product-3_PabLrYn6okMUwr",
"name": "Product 1",
"image": "https://picsum.photos/200",
"price": 10000,
"category": 1
},
{
"id": "product--4PQjQTklQLDLsB2",
"name": "Product 2",
"image": "https://picsum.photos/200",
"price": 30000,
"category": 2
},
]
}
}
POST /products
Authorization: Bearer <access_token>
Content-Type: application/json
{
"status": string,
"message": string,
"data": object,
}
{
"status": "success",
"message": "Produk berhasil ditambahkan",
"data": {
"productId": 1
}
}
{
"image": "https://picsum.photos/200",
"price": 50000,
"description": "sambal enak sekali",
"name": "sambal khas",
"umkm": {
"name": "Sambal Mantu",
"employe": 1000,
"location": {
"name": "Denpasar, Bali",
"lat ": -34.397,
"lng ": 150.644
}
},
"resources": [
{
"name": "cabai",
"image": "https://picsum.photos/200",
"description": "pedas",
"location": {
"name": "Wonogiri, Jawa Tengah",
"lat ": -34.397,
"lng ": 150.644
},
"umkm": "Sukamaju"
},
{
"name": "batu",
"image": "https://picsum.photos/200",
"description": "lorem100",
"location": {
"name": "Wonogiri, Jawa Tengah",
"lat ": -34.397,
"lng ": 150.644
},
"umkm": "Sukamaju"
},
{
"name": "batu",
"image": "https://picsum.photos/200",
"description": "lorem100",
"location": {
"name": "New York, US",
"lat ": -34.397,
"lng ": 150.644
}
}
],
"production": [
{
"name": "pengumpulan bahan baku",
"image": "https://picsum.photos/200",
"description": "lorem100"
},
{
"name": "penumbukan",
"image": "https://picsum.photos/200",
"description": "lorem100"
},
{
"name": "pengemasan",
"image": "https://picsum.photos/200",
"description": "lorem100"
}
],
"impact": [
{
"name": "batu",
"icon": 1,
"description": "lorem100"
},
{
"name": "batu",
"icon": 2,
"description": "lorem100"
},
{
"name": "batu",
"icon": 3,
"description": "lorem 100"
}
],
"contribution": [
{
"icon": 1,
"description": "lorem 100"
},
{
"icon": 1,
"description": "lorem100"
},
{
"icon": "https://picsum.photos/200",
"description": "lorem100"
}
],
"category": null
}
PUT /products
Authorization: Bearer <access_token>
Content-Type: application/json
{
"status": string,
"message": string,
}
{
"status": "success",
"message": "Produk berhasil diperbrui",
}
{
"id": "xxx",
"image": "http://a.jpg",
"price": 13000,
"description": "lorem100",
"name": "sambal kuning",
"umkm": {
"name": "Sambal Mantu",
"employe": 1000,
"location": "koordinat"
},
"resources": [
{
"name": "cabai",
"image": "https://image.com/",
"description": "pedas",
"location": "koordinat"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100",
"location": "koordinat"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100",
"location": "koordinat"
}
],
"production": [
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
}
],
"impact": [
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem100"
}
],
"contribution": [
{
"icon": "https://image.com/",
"description": "lorem100"
},
{
"icon": "https://image.com/",
"description": "lorem100"
},
{
"icon": "https://image.com/",
"description": "lorem100"
}
]
}
DELETE /products/:id
Authorization: Bearer <access_token>
Content-Type: application/json
{
"status": string,
"message": string,
}
{
"status": "success",
"message": "Produk berhasil dihapus",
}
GET /umkm
{
"error" : bool,
"status" : string,
"message" : string,
"count" : int,
"data" : object,
}
{
"error": false,
"status": "success",
"message": "Menampilkan semua umkm",
"count": 2,
"data": {
"umkm": [
{
"id": "umkm-xyz1",
"logo": "https://picsum.photos/200",
"name": "Trackmate",
"location": {
"lat": -34.397,
"lng": 150.644,
"name": "Wonogiri, Jawa Tengah"
}
},
{
"id": "Umkm-VKDhH1FD3QbdzH6s",
"logo": "https://i.ibb.co/BwNSbMb/logo-mamo.jpg",
"name": "Sambal Mamo",
"location": {
"lat": -8.113750063882303,
"lng": 115.0913508971701,
"name": "Jl. Ngurah Rai, Buleleng, Bali"
}
},
]
}
}
GET /umkm/:id
{
"error" : bool,
"status" : string,
"data" : object,
}
{
"error": false,
"status": "success",
"data": {
"umkm": {
"id": "Umkm-VKDhH1FD3QbdzH6s",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"logo": "https://i.ibb.co/BwNSbMb/logo-mamo.jpg",
"name": "Sambal Mamo",
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"location": {
"lat": -8.113750063882303,
"lng": 115.0913508971701,
"name": "Jl. Ngurah Rai, Buleleng, Bali"
},
"history": {
"text": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"image": "https://i.ibb.co/0fr1VCg/image.jpg"
},
"impact": [
{
"name": "Carbon Footprint",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Meminimalisir potensi jejak karbon baik secara individu/kelompok"
},
{
"name": "Waste Management",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Melakukan tracing dalam upaya pengurangan limbah sekitar lingkungan usaha"
},
{
"name": "Water Use",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Meniliki upaya efisiensi penggunaan air"
},
{
"name": "Product Lyfecycle",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Memiliki daur hidup produk agar membantu meminimalisir kerusakan lingkungan"
},
{
"name": "Health and Safety",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Mengukur kadar keamanan produk dalam penggunaan, keberlanjutan bahan baku dan pemanfaatan potensi daur ulang produk"
},
{
"name": "Working Condition",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Menilik iklim komunikasi dalam lingkup pekerjaan dan sosial yang berkaitan dengan kesejahteraan dan kenyamanan pekerja"
},
{
"name": "Human Right",
"image": "https://i.ibb.co/0fr1VCg/image.jpg",
"description": "Meninjau pemenuhan hak-hak pekerja dalam berbagai aspek dengan berlandaskan regulasi yang berlaku hingga dimungkinkan adanya standarisasi"
}
],
"contact": [
{
"email": "08123456789",
"phone": {
"isWhatsApp": true,
"phoneNumber": "0019272138",
"waNumber": "0019272138"
}
}
],
"owner": "user-ck3VlWtOkmMiEoU2",
"createdAt": "2023-11-28T13:06:42.530Z",
"updatedAt": "2023-11-28T13:06:42.530Z"
}
}
}
POST /umkm
Authorization: Bearer <access_token>
Content-Type: application/json
{
"name": string,
}
{
"name": "Sambal mamo",
}
{
"error": bool,
"status": string,
"message": string,
"data": object,
}
{
"error": false,
"status": "success",
"message": "UMKM berhasil didaftarkan",
"data": {
"umkmId": "umkm-djjhfsjd"
}
}
PUT /umkm
Authorization: Bearer <access_token>
Content-Type: application/json
{
"image": string,
"name": string,
"logo": string,
"description": string,
"location": object,
"history": object,
"impact": array,
"contact" : array
}
{
"image": "http://a.jpg",
"logo": "http://a.jpg",
"name": "PT Sambal 2",
"description": "lorem100",
"location": "jshak hdak",
"history": {
"image": "http://a.jpg",
"text": "sambal kuning"
},
"impact": [
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
}
],
"contact" : [
{
"name": "whatsapp",
"description": "08123456789"
},
{
"name": "email",
"description": "sambal@gmail.com"
}
]
}
{
"error": bool,
"status": string,
"message": string
}
## Delete UMKM
- Path
```http
DELETE /umkm/:id
Authorization: Bearer <access_token>
Content-Type: application/json
{
"status": string,
"message": string,
}
{
"status": "success",
"message": "Profil UMKM berhasil diupdate",
}
{
"image": "http://a.jpg",
"name": "PT Sambal 2",
"description": "lorem100",
"location": "jshak hdak",
"history": {
"image": "http://a.jpg",
"text": "sambal kuning"
},
"impact": [
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
},
{
"name": "batu",
"image": "https://image.com/",
"description": "lorem 100"
}
],
"contact" : [
{
"name": "whatsapp",
"description": "08123456789"
},
{
"name": "email",
"description": "sambal@gmail.com"
}
]
}
{
"error" : bool,
"status" : string,
"message" : string,
}
{
"error": true,
"status": "fail",
"message": "Product tidak ditemukan",
}
{
"error" : bool,
"status" : string,
"message" : string,
"stack" : string,
}
{
"error": true,
"status": "error",
"message": "terjadi kegagalan pada server kami",
"stack": "TypeError: Cannot read ...."
}
| Status Code | Description |
|---|---|
| 200 | OK |
| 201 | CREATED |
| 400 | BAD REQUEST |
| 404 | NOT FOUND |
| 500 | INTERNAL SERVER ERROR |
Made with ❤ by Tim CC (Cobo Canaeru) Eheek