# 📱 Tutorial Login & Connect Semua Sosmed (Bahasa Indonesia)

Panduan lengkap step-by-step untuk daftar developer app & dapat credentials untuk **9 platform sosmed**. Setiap platform punya estimasi waktu, link langsung, redirect URI yang harus disetel, dan tips troubleshooting.

> **VPS URL Anda**: `http://147.93.159.211:8000`
> **Redirect URI base**: `http://147.93.159.211:8000/api/social-accounts/oauth/callback/{platform_id}`

Setelah dapat credentials, masukkan via Dashboard → **🔐 Social Connect Hub** → **🚀 Quick Setup Wizard** → klik platform → paste keys → Save. **NO SSH NEEDED.**

---

## ⚡ TIER 1 — PALING CEPAT (2-15 menit)

### 1. ✈️ Telegram Bot (2 menit) ⭐ DONE!

✅ **Sudah berhasil** — `@adzkia35_super_leader_bot` aktif 24/7.

---

### 2. 🧵 Threads (15 menit) — Meta-owned, growth pesat

**Estimasi:** 15-20 menit | **Difficulty:** ⭐⭐ Medium | **Cost:** Gratis

**Step 1 — Daftar Meta Developer App TERPISAH dari Facebook**:
1. Buka https://developers.facebook.com/apps
2. Login dengan akun Facebook owner (Dzoel)
3. Klik **"Create App"** (kanan atas hijau)
4. Pilih use case: **"Other"** → **"Next"**
5. App type: **"Consumer"** → **"Next"**
6. Nama app: `Adzkia35 Threads`
7. Contact email: `adzkiasalsadzoel@gmail.com`
8. Klik **"Create App"**

**Step 2 — Add Threads Product**:
1. Di sidebar app dashboard, klik **"Add Product"**
2. Cari **"Threads"** → klik **"Set up"**
3. Threads → Settings → **Use cases** → pilih:
   - Access basic profile info
   - Access content publishing
   - Access insights & analytics

**Step 3 — Set Redirect URI**:
1. Threads → **Settings → Basic** → scroll bawah
2. **Valid OAuth Redirect URIs** → paste:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/threads
   ```
3. Klik **"Save Changes"**

**Step 4 — Catat Credentials**:
- App ID (atas, format 16 digit angka): contoh `1234567890123456`
- App Secret: klik **"Show"** di Settings → Basic

**Step 5 — Paste di Dashboard**:
1. Buka dashboard → Social Connect Hub → Quick Setup Wizard
2. Klik tombol **🧵 Threads**
3. Paste THREADS_APP_ID + THREADS_APP_SECRET
4. **Save Credentials**

**Step 6 — OAuth Connect**:
1. Status card Threads → klik **Setup**
2. Klik **🔗 Connect via OAuth (popup)**
3. Login Threads → Approve → bot save token otomatis

⚠️ **Catatan**: Threads pakai Meta app TERPISAH dari Facebook Login app. Kalau pakai 1 app yang sama, conflict scope.

---

### 3. 📌 Pinterest (15 menit)

**Estimasi:** 10-15 menit | **Difficulty:** ⭐ Easy | **Cost:** Gratis

**Step 1 — Convert Akun ke Business**:
1. Buka Pinterest, login akun owner
2. Settings → **Account management** → **Convert to business account** (gratis)
3. Isi info: nama brand "Adzkia35", category "Fashion", website (kalau ada)

**Step 2 — Daftar Developer App**:
1. Buka https://developers.pinterest.com/apps/
2. Klik **"Create app"**
3. App name: `Adzkia35 Pinterest Manager`
4. Description: `AI agent management untuk Adzkia35 hijab brand`

**Step 3 — Configure App**:
1. Sandbox mode dulu (production butuh review)
2. Redirect URIs → paste:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/pinterest
   ```
3. Scopes pilih: `boards:read`, `pins:read`, `pins:write`, `user_accounts:read`

**Step 4 — Catat**:
- **App ID** (di app detail page)
- **App Secret** (klik "Show" untuk reveal)

**Step 5 — Paste di Dashboard** (sama seperti Threads):
- Quick Setup Wizard → 📌 Pinterest → paste keys → Save

⚠️ **Limit Sandbox**: 5 pin/hari testing. Untuk production buka request "trade up" di Pinterest Developer Portal.

---

## 🎬 TIER 2 — VIDEO/CONTENT PLATFORM (15-30 menit)

### 4. ▶️ YouTube (15-25 menit) — Long-form + Shorts

**Estimasi:** 15-25 menit | **Difficulty:** ⭐⭐⭐ Medium-Hard | **Cost:** Gratis

**Step 1 — Buka Google Cloud Console**:
1. Buka https://console.cloud.google.com
2. Login dengan akun Google yang punya YouTube channel
3. Buat project baru: **"Adzkia35 AI Agents"**

**Step 2 — Enable YouTube APIs**:
1. Sidebar → **APIs & Services → Library**
2. Search & enable masing-masing:
   - **YouTube Data API v3** → klik Enable
   - **YouTube Analytics API** → klik Enable
   - **YouTube Reporting API** → klik Enable (opsional)

**Step 3 — Setup OAuth Consent Screen**:
1. APIs & Services → **OAuth consent screen**
2. User Type: **External** → Create
3. App name: `Adzkia35 AI Agents`
4. User support email: `adzkiasalsadzoel@gmail.com`
5. Developer email: sama
6. Klik **Save and Continue**
7. **Scopes** → Add or Remove Scopes:
   - `https://www.googleapis.com/auth/youtube.upload`
   - `https://www.googleapis.com/auth/youtube.readonly`
   - `https://www.googleapis.com/auth/yt-analytics.readonly`
8. **Test users** → Add: `adzkiasalsadzoel@gmail.com` (& akun YouTube lain kalau ada)
9. **Submit for verification** SKIP dulu (gak perlu kalau cuma self-use)

**Step 4 — Create OAuth Credentials**:
1. APIs & Services → **Credentials**
2. **Create Credentials → OAuth client ID**
3. Application type: **Web application**
4. Name: `Adzkia35 YouTube OAuth`
5. **Authorized redirect URIs**:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/youtube
   ```
6. Klik **Create**

**Step 5 — Catat Credentials**:
- Client ID: format `xxxxx.apps.googleusercontent.com`
- Client Secret: format `GOCSPX-xxxxxxxxxxxxxxxx`

**Step 6 — Paste di Dashboard**:
- Quick Setup Wizard → ▶️ YouTube → paste keys → Save
- Klik Setup → Connect via OAuth → login Google → grant permissions

⚠️ **Test mode limit**: 100 users only sampai verification. Untuk publik butuh Google review (~2-4 minggu).

---

### 5. 🎵 TikTok (20-40 menit) — Video + Marketing API

**Estimasi:** 20-40 menit | **Difficulty:** ⭐⭐⭐⭐ Hard (butuh app review untuk full) | **Cost:** Gratis

**Step 1 — Daftar Developer Account**:
1. Buka https://developers.tiktok.com/
2. Klik **"Login"** → login dengan TikTok account brand (atau personal owner)
3. **Manage apps** → **Connect an app**

**Step 2 — Create App**:
1. App name: `Adzkia35 Content Manager`
2. App description: `AI-powered content management & marketing untuk Adzkia35 hijab premium brand`
3. Category: **"Fashion & Lifestyle"**
4. Privacy Policy URL: bisa pakai https://adzkia35.com/privacy (atau placeholder dulu)
5. Terms of Service URL: sama

**Step 3 — Add Products**:
1. **Login Kit** (basic OAuth)
2. **Content Posting API** (upload video)
3. **Marketing API** (analytics + ads, butuh approval terpisah)

**Step 4 — Redirect URI**:
1. Login Kit → Settings → **Redirect URI**:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/tiktok
   ```
2. Scopes pilih:
   - `user.info.basic`
   - `video.list`
   - `video.upload`
   - `video.publish`

**Step 5 — Catat Credentials**:
- **Client Key**: format `awxxxxxxxxxxxxxx`
- **Client Secret**: panjang random string

**Step 6 — Paste di Dashboard**:
- Quick Setup Wizard → 🎵 TikTok → paste TIKTOK_APP_KEY + TIKTOK_APP_SECRET → Save

⚠️ **App Review**:
- Sandbox mode = OK untuk testing dengan akun developer sendiri
- Production = butuh App Review TikTok (1-2 minggu, kasih demo video penggunaan)
- Marketing API approval lebih ketat (butuh bukti spending ad)

---

## 💼 TIER 3 — PROFESSIONAL/BUSINESS (15-30 menit)

### 6. 💼 LinkedIn (25-40 menit) — B2B, Lead Gen

**Estimasi:** 25-40 menit | **Difficulty:** ⭐⭐⭐ Medium (verifikasi page wajib) | **Cost:** Gratis

**Step 1 — Buat LinkedIn Company Page** (kalau belum ada):
1. Buka https://www.linkedin.com/company/setup/new/
2. Page type: **Company**
3. Name: `Adzkia35`
4. Industry: `Apparel & Fashion`
5. Klik **Create page**

**Step 2 — Daftar Developer App**:
1. Buka https://www.linkedin.com/developers/apps
2. **Create app**
3. App name: `Adzkia35 Marketing Manager`
4. LinkedIn Page: pilih `Adzkia35` (yg baru dibuat)
5. Privacy policy URL: `https://adzkia35.com/privacy`
6. Logo: upload logo brand
7. **Create app**

**Step 3 — Verify Page**:
1. App detail → **Settings** → **Verify**
2. Generate verification URL → buka di tab baru
3. Login sebagai admin page → Approve
4. Status: ✅ Verified

**Step 4 — Add Products**:
1. **Products tab**
2. Request access:
   - **Sign In with LinkedIn using OpenID Connect** (instant)
   - **Share on LinkedIn** (instant)
   - **Marketing Developer Platform** ⚠️ (perlu review, isi form 5 menit)
3. Tunggu approval Marketing Developer Platform (1-3 hari kerja)

**Step 5 — Authentication Settings**:
1. **Auth** tab
2. **Authorized Redirect URLs**:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/linkedin
   ```
3. Scopes: `w_member_social`, `r_organization_social`, `r_basicprofile`, `r_emailaddress`

**Step 6 — Catat**:
- **Client ID** (di Auth tab)
- **Client Secret** (di Auth tab)

**Step 7 — Paste di Dashboard**:
- Quick Setup Wizard → 💼 LinkedIn → paste → Save

⚠️ **Marketing Developer Platform** = required untuk posting ke Company Page. Without it, hanya bisa post ke personal profile.

---

### 7. 🐦 X (Twitter) (20-30 menit)

**Estimasi:** 20-30 menit | **Difficulty:** ⭐⭐⭐ Medium (Free tier limit posting) | **Cost:** Free / $100/bln Basic / $5000/bln Pro

**Step 1 — Apply Developer Account**:
1. Buka https://developer.twitter.com/en/portal/dashboard
2. Klik **"Sign up for Free Account"**
3. Use case description (250+ chars), contoh:
   > *"AI-powered social media management untuk brand Adzkia35 (hijab premium Indonesia). Tujuan: auto-post product launches, schedule content cross-platform, analyze engagement metrics, respond to customer inquiries. Tidak untuk spam/scraping. Volume estimasi: 30 tweets/bulan, 100 reads/hari."*
4. Pilih: **"Building tools for business"**
5. Submit (instant approval untuk Free tier)

**Step 2 — Create Project + App**:
1. Dashboard → **Create Project**
2. Name: `Adzkia35 Brand Manager`
3. Use case: `Building tools for businesses`
4. Description: sama dgn yang di apply
5. Create App di dalam project → name: `adzkia35-x-bot`

**Step 3 — User Authentication Settings**:
1. App → **User authentication settings** → **Set up**
2. App permissions: **Read and write** (untuk posting)
3. Type of App: **Web App, Automated App or Bot**
4. App info:
   - Callback URI: `http://147.93.159.211:8000/api/social-accounts/oauth/callback/twitter_x`
   - Website URL: `https://adzkia35.com`
   - Organization name: `Adzkia35`
5. Save

**Step 4 — Catat Credentials** (Keys and tokens tab):
- **API Key** (= Consumer Key)
- **API Key Secret** (= Consumer Secret)
- **Bearer Token** (untuk app-only auth)
- Generate **Access Token** + Secret (untuk user context)

**Step 5 — Paste di Dashboard**:
- Quick Setup Wizard → 🐦 X (Twitter) → paste X_API_KEY, X_API_SECRET, X_BEARER_TOKEN → Save

⚠️ **Free tier limits 2026**:
- 500 posts/bulan write
- 100 reads/bulan
- No streaming
- Cukup untuk brand maintenance ringan

---

### 8. 💬 WhatsApp Business (20-30 menit) — Meta Cloud API

**Estimasi:** 20-30 menit | **Difficulty:** ⭐⭐⭐ Medium (butuh business verification) | **Cost:** Free 1000 conversations/bln + $0.0058-0.062/conv

**Step 1 — Buat Meta Business Account**:
1. Buka https://business.facebook.com → Create
2. Business name: `PT Digital Global Mulia Kreasi`
3. Your name: `Dzoel Fikri S`
4. Email: `adzkiasalsadzoel@gmail.com`
5. Submit

**Step 2 — Add WhatsApp to Meta App**:
1. Buka https://developers.facebook.com/apps → klik app Anda (atau buat baru)
2. **Add Product** → **WhatsApp** → Set up
3. WhatsApp → **API Setup**

**Step 3 — Add Phone Number**:
1. Quickstart → **Add phone number**
2. Display name: `Adzkia35 CS`
3. Category: `Shopping & Retail`
4. Description: brand hijab premium
5. Add phone number (HARUS nomor yang belum pernah dipakai WhatsApp Business app — atau pakai nomor demo dari Meta untuk testing)

**Step 4 — Catat Credentials**:
- **Phone number ID** (di API Setup tab)
- **WhatsApp Business Account ID** (di API Setup tab)
- **Permanent Access Token**:
  - System Users → Add → Admin role
  - Generate New Token → 60-day atau Permanent (recommended)
  - Copy token (panjang format `EAA...`)

**Step 5 — Verify Webhook** (opsional untuk receive messages):
1. Webhooks tab → Setup
2. Callback URL: `http://147.93.159.211:8000/api/social-accounts/whatsapp/webhook`
3. Verify token: bebas string random
4. Subscribe to: `messages`, `message_status`

**Step 6 — Paste di Dashboard**:
- Quick Setup Wizard → 💬 WhatsApp Biz → paste WHATSAPP_PHONE_ID + WHATSAPP_BUSINESS_ID + WHATSAPP_ACCESS_TOKEN → Save

⚠️ **Business Verification**:
- Untuk send messages to >250 unique users/24h: butuh Business Verification Meta (upload SIUP/NIB Indonesia, 5-10 hari kerja)
- Cuma template message yang bisa send tanpa user inisiasi conversation
- Detail pricing: https://developers.facebook.com/docs/whatsapp/pricing/

---

## 🎨 TIER 4 — NICHE/OPTIONAL (15-25 menit)

### 9. 👻 Snapchat (20-30 menit)

**Estimasi:** 20-30 menit | **Difficulty:** ⭐⭐⭐ Medium

**Step 1 — Buka Snapchat Business Manager**:
1. https://business.snapchat.com/login
2. Login dengan akun Snapchat
3. Create Organization → `Adzkia35`

**Step 2 — Create App di Snapchat Developer Portal**:
1. https://kit.snapchat.com/portal/apps
2. **Add app**: `Adzkia35 Snap Manager`
3. Add features: **Login Kit** + **Marketing API**

**Step 3 — OAuth Settings**:
1. Login Kit → Redirect URLs:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/snapchat
   ```
2. Scopes: `snapchat-marketing-api`

**Step 4 — Catat**:
- Client ID
- Client Secret

**Step 5 — Paste di Dashboard**:
- Quick Setup Wizard → tab "Other" (kalau tidak ada di list 8 default, pakai endpoint manual)

⚠️ Snapchat = niche untuk Gen Z. Skip kalau target Anda kantoran 25-35y.

---

### 10. 🎮 Twitch (15-20 menit) — Live Streaming Multi-platform

**Estimasi:** 15-20 menit | **Difficulty:** ⭐⭐ Easy

**Step 1 — Daftar Developer**:
1. https://dev.twitch.tv/console/apps
2. Login dengan Twitch account
3. **Register Your Application**
4. Name: `Adzkia35 Live Stream Manager`

**Step 2 — Configure**:
1. OAuth Redirect URLs:
   ```
   http://147.93.159.211:8000/api/social-accounts/oauth/callback/twitch
   ```
2. Category: **Application Integration**

**Step 3 — Catat**:
- Client ID
- Client Secret (klik **New Secret**)

**Step 4 — Paste di Dashboard**

⚠️ Twitch = mostly gaming. Skip kalau bukan target.

---

## 📋 Cheat Sheet — Redirect URI untuk Setiap Platform

Copy-paste ke developer portal masing-masing:

| Platform | Redirect URI |
|---|---|
| Threads | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/threads` |
| YouTube | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/youtube` |
| TikTok | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/tiktok` |
| LinkedIn | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/linkedin` |
| X (Twitter) | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/twitter_x` |
| Pinterest | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/pinterest` |
| Snapchat | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/snapchat` |
| Twitch | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/twitch` |
| Facebook/Instagram | `http://147.93.159.211:8000/api/social-accounts/oauth/callback/facebook` |
| WhatsApp Biz | `http://147.93.159.211:8000/api/social-accounts/whatsapp/webhook` |

---

## 🔄 Setelah Save Credentials di Dashboard

1. Status card platform berubah dari ⚫ Not Connected → 🟡 Partial
2. Klik card → modal **Setup**
3. Klik **🔗 Connect via OAuth (popup)**
4. Login akun real → Approve permissions
5. Window popup auto-close, status jadi ✅ Connected
6. Account masuk ke Multi-Account list (kategori bisa di-edit: business/personal/affiliate)

## 🆘 Troubleshooting

**"Invalid redirect URI"**
- Pastikan URI di developer portal **PERSIS** sama (case-sensitive, trailing slash matter)
- Check spasi tersembunyi saat copy-paste

**"App not approved"**
- Untuk testing tanpa review: tambahkan akun owner ke "Test Users" / "App Roles"
- Sandbox mode = OK untuk dev, production butuh review

**"Token expired"**
- Long-lived token biasanya 60 hari (Meta), 7-365 hari (TikTok), refresh-able (YouTube)
- Sistem auto-refresh untuk platform yang support refresh_token

**OAuth popup blocked**
- Allow popup di browser
- Atau buka URL OAuth manual di tab baru (URL ada di Setup modal)

**Stuck di "Loading..."**
- Cek `/api/social-accounts/status` di Swagger UI
- Cek docker logs: `ssh root@147.93.159.211 "docker logs business_ai_web --tail 30"`

---

## 🎯 Priority Order Rekomendasi

**Untuk Brand Adzkia35 (hijab/fashion ID-target)**:

1. ✅ Telegram Bot (DONE)
2. ✅ Facebook + Instagram (DONE via Meta MCP)
3. 🧵 **Threads** (15 min) — growth pesat, Meta-owned
4. 🎵 **TikTok** (30 min) — Asian audience besar
5. ▶️ **YouTube** (20 min) — Shorts + tutorial hijab
6. 💬 **WhatsApp Business** (20 min) — CS otomasi
7. 📌 **Pinterest** (15 min) — niche fashion ID
8. 💼 **LinkedIn** (30 min) — B2B kalau ada wholesale
9. 🐦 X — kalau target audience aktif Twitter (skip kalau gak)
10. 👻 🎮 Snapchat / Twitch — skip untuk Adzkia35

Total commit waktu serius: ~2-3 jam untuk top 5 platforms. Sisanya 1-2 jam kalau mau semua.

---

**📚 Lihat juga:** `MARKETPLACE_API_TUTORIAL_ID.md` untuk Shopee/Tokopedia/TikTok Shop/Lazada.
