Profil Pengguna (Profile)
Dokumentasi API untuk pengelolaan data pribadi, profil publik, dan dasbor ringkasan aktivitas pengguna.
Endpoint Overview
| Method | Endpoint | Deskripsi |
|---|---|---|
| GET | /profiles | Mengambil data profil lengkap pengguna. |
| PUT | /profiles | Memperbarui data profil pengguna. |
| GET | /profiles/dashboard | Mengambil ringkasan aktivitas (poin, pesanan, wishlist). |
| POST | /profiles/avatar/upload | Mengunggah foto profil baru. |
| POST | /profiles/facebook/delete-user | Menghapus data user dari Facebook (Compliance). |
1. Get User Profile
Mengambil detail informasi profil pengguna yang sedang login.
- URL:
/profiles - Method:
GET - Headers:
Authorization: Bearer {{token}} - Response (200 OK):
{
"status": true,
"code": 200,
"data": {
"id": "uuid",
"full_name": "Mas Pri Atourin",
"email": "priyono@atourin.com",
"phone_number": "081234567890",
"gender": "male",
"birthdate": "1990-01-01",
"nationality": "Indonesia",
"interests": ["Alam", "Kuliner"],
"avatar": "https://storage.googleapis.com/..."
},
"msg": "Ok"
}
2. Update Profile
Memperbarui informasi profil pengguna.
- URL:
/profiles - Method:
PUT - Headers:
Authorization: Bearer {{token}} - Body (JSON):
{
"full_name": "Mas Pri Atourin Update",
"gender": "male",
"birthdate": "1990-01-01",
"interests": ["Alam", "Kuliner", "Budaya"]
}
- Response (200 OK):
{
"status": true,
"code": 200,
"info": "Success update profile",
"msg": "Ok"
}
3. User Dashboard Summary
Digunakan untuk menampilkan statistik cepat di halaman akun pengguna seperti jumlah poin, pesanan aktif, dan jumlah wishlist.
- URL:
/profiles/dashboard - Method:
GET - Headers:
Authorization: Bearer {{token}} - Response (200 OK):
{
"status": true,
"code": 200,
"data": {
"points": 1500,
"pending_orders": 2,
"wishlist_count": 12
},
"msg": "Ok"
}
4. Avatar Upload
Mengunggah file gambar (JPG/PNG) untuk dijadikan foto profil.
- URL:
/profiles/avatar/upload - Method:
POST - Headers:
Authorization: Bearer {{token}} - Content-Type:
multipart/form-data - Body:
avatar: (File binary)
- Response (200 OK):
{
"status": true,
"code": 200,
"info": "Success upload avatar",
"data": {
"url": "https://storage.googleapis.com/atourin-bucket/avatars/..."
},
"msg": "Ok"
}
5. Facebook Delete User
Endpoint kepatuhan (compliance) untuk menghapus data pengguna yang masuk melalui Facebook.
- URL:
/profiles/facebook/delete-user - Method:
POST - Body (JSON):
{
"signed_request": "string_from_facebook"
}
- Response (200 OK):
{
"status": true,
"code": 200,
"info": "Success delete user account",
"msg": "Ok"
}
🔥 Uji Coba API (Simulator)
Gunakan simulator di bawah ini untuk mencoba seluruh endpoint di atas secara langsung. Anda dapat mengubah URL, Method, Headers, dan Body sesuai kebutuhan.