ข้อมูลแอปพลิเคชัน
ดูข้อมูลเกี่ยวกับแอปพลิเคชัน, การใช้โควต้า และสถานะ Subscription
Endpoint
http
GET /meURL เต็ม: https://developer.easyslip.com/api/v1/me
การยืนยันตัวตน
จำเป็น ดูคู่มือการยืนยันตัวตน
http
Authorization: Bearer YOUR_API_KEYRequest
ไม่ต้องมี Request Body
Type Definitions
typescript
// Response
interface MeResponse {
status: 200;
data: MeData;
}
interface MeData {
application: string;
usedQuota: number;
maxQuota: number | null;
remainingQuota: number | null;
expiredAt: string; // ISO 8601
currentCredit: number;
}
// Error Response
interface ErrorResponse {
status: number;
message: string;
}ตัวอย่าง
bash
curl -X GET https://developer.easyslip.com/api/v1/me \
-H "Authorization: Bearer YOUR_API_KEY"javascript
const getMe = async () => {
const response = await fetch('https://developer.easyslip.com/api/v1/me', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const result = await response.json();
if (result.status !== 200) {
throw new Error(result.message);
}
return result.data;
};
// การใช้งาน
const info = await getMe();
console.log('แอปพลิเคชัน:', info.application);
console.log('โควต้าที่เหลือ:', info.remainingQuota);php
function getMe(): array
{
$apiKey = getenv('EASYSLIP_API_KEY');
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://developer.easyslip.com/api/v1/me',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey
]
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if ($result['status'] !== 200) {
throw new Exception($result['message']);
}
return $result['data'];
}
// การใช้งาน
$info = getMe();
echo "แอปพลิเคชัน: " . $info['application'];python
import requests
import os
def get_me() -> dict:
response = requests.get(
'https://developer.easyslip.com/api/v1/me',
headers={
'Authorization': f'Bearer {os.environ["EASYSLIP_API_KEY"]}'
}
)
result = response.json()
if result['status'] != 200:
raise Exception(result['message'])
return result['data']
# การใช้งาน
info = get_me()
print(f"แอปพลิเคชัน: {info['application']}")
print(f"โควต้าที่เหลือ: {info['remainingQuota']}")Response
สำเร็จ (200)
json
{
"status": 200,
"data": {
"application": "แอปพลิเคชันของฉัน",
"usedQuota": 1500,
"maxQuota": 35000,
"remainingQuota": 33500,
"expiredAt": "2025-01-01T00:00:00+07:00",
"currentCredit": 5000
}
}ฟิลด์ใน Response
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
application | string | ชื่อแอปพลิเคชัน |
usedQuota | number | โควต้าที่ใช้ไปในรอบนี้ |
maxQuota | number | null | โควต้าสูงสุด (null = ไม่จำกัด) |
remainingQuota | number | null | โควต้าที่เหลือ |
expiredAt | string | วันหมดอายุ Subscription (ISO 8601) |
currentCredit | number | เครดิตที่มี |
Error Responses
ไม่ได้รับอนุญาต (401)
json
{
"status": 401,
"message": "unauthorized"
}ถูกปฏิเสธการเข้าถึง (403)
json
{
"status": 403,
"message": "access_denied"
}Server Error (500)
json
{
"status": 500,
"message": "server_error"
}หมายเหตุ
- Endpoint นี้ไม่หักโควต้า
- โควต้าจะรีเซ็ตตามรอบบิล (รายเดือนหรือรายปี)
maxQuota: nullหมายถึงโควต้าไม่จำกัด- เครดิตใช้สำหรับการต่ออายุอัตโนมัติและฟีเจอร์เสริม