Quickstart
3. Make Your First API Call

ทำ 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 UnauthorizedKey หายหรือรูปแบบผิดตรวจสอบ header Authorization: Bearer pip_…
403 ForbiddenKey ถูกยกเลิกหรือ scope ไม่พอสร้าง key ใหม่ใน Console
404 Not FoundPath ของ endpoint ผิดตรวจสอบ API Reference

ขั้นตอนถัดไป