ทำ API Call แรก
เมื่อมี M2M API key แล้ว ทดสอบว่าทุกอย่างใช้งานได้
ดึงข้อมูล user / app identity ที่ authenticated
export PIP_API_KEY="pip_live_xxxxxxxx"
curl https://pip.pcampus.co/identity/me \
-H "Authorization: Bearer $PIP_API_KEY"Response ที่คาดหวัง
{
"id": "usr_xxxxxxxxxxxx",
"email": "you@example.com",
"displayName": "Your Name",
"organizationId": "org_xxxxxxxxxxxx",
"createdAt": "2026-01-01T00:00:00.000Z"
}ถ้าเห็น JSON response พร้อม user หรือ application details แสดงว่าพร้อมแล้ว
แก้ไขปัญหา
| Status | สาเหตุ | วิธีแก้ |
|---|---|---|
401 Unauthorized | Key หายหรือรูปแบบผิด | ตรวจสอบ header Authorization: Bearer pip_… |
403 Forbidden | Key ถูกยกเลิกหรือ scope ไม่พอ | สร้าง key ใหม่ใน Console |
404 Not Found | Path ของ endpoint ผิด | ตรวจสอบ API Reference |
ขั้นตอนถัดไป
- Identity Platform → — users, orgs, access control
- API Reference → — รายการ endpoint ทั้งหมด
- SDKs → — JavaScript SDK (เร็วๆ นี้)