GET /info
ดูข้อมูลเกี่ยวกับแอปพลิเคชัน, Branch และการใช้โควต้า
Endpoint
http
GET /infoURL เต็ม: https://api.easyslip.com/v2/info
การยืนยันตัวตน
จำเป็น ดูคู่มือการยืนยันตัวตน
http
Authorization: Bearer YOUR_API_KEYRequest
ไม่ต้องมี Request Body
Type Definitions
typescript
// Response Types
interface InfoResponse {
success: true;
data: InfoData;
message: string;
}
interface InfoData {
application: Application;
branch: Branch;
account: Account;
product: Product;
}
interface Application {
name: string;
autoRenew: AutoRenew;
quota: ApplicationQuota;
}
interface AutoRenew {
expired: boolean;
quota: boolean;
createdAt: string; // ISO 8601
expiresAt: string; // ISO 8601
}
interface ApplicationQuota {
used: number;
max: number | null; // null = ไม่จำกัด
remaining: number | null;
totalUsed: number;
}
interface Branch {
name: string;
isActive: boolean;
quota: BranchQuota;
}
interface BranchQuota {
used: number;
totalUsed: number;
}
interface Account {
email: string;
credit: number;
}
interface Product {
name: string;
}
// Error Response
interface ErrorResponse {
success: false;
error: {
code: string;
message: string;
};
}ตัวอย่าง
bash
curl -X GET https://api.easyslip.com/v2/info \
-H "Authorization: Bearer YOUR_API_KEY"javascript
const response = await fetch('https://api.easyslip.com/v2/info', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const result = await response.json();
console.log(result.data);php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.easyslip.com/v2/info',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result['data']);python
import requests
import os
response = requests.get(
'https://api.easyslip.com/v2/info',
headers={'Authorization': f'Bearer {os.environ["EASYSLIP_API_KEY"]}'}
)
result = response.json()
print(result['data'])Response
Response สำเร็จ (200)
json
{
"success": true,
"data": {
"application": {
"name": "แอปพลิเคชันของฉัน",
"autoRenew": {
"expired": false,
"quota": true,
"createdAt": "2024-01-01T00:00:00+07:00",
"expiresAt": "2025-01-01T00:00:00+07:00"
},
"quota": {
"used": 1500,
"max": 35000,
"remaining": 33500,
"totalUsed": 45000
}
},
"branch": {
"name": "Main Branch",
"isActive": true,
"quota": {
"used": 500,
"totalUsed": 12000
}
},
"account": {
"email": "[email protected]",
"credit": 5000
},
"product": {
"name": "Pro Plan"
}
},
"message": "Information retrieved successfully"
}ฟิลด์ใน Response
| ฟิลด์ | ประเภท | คำอธิบาย |
|---|---|---|
application.name | string | ชื่อแอปพลิเคชัน |
application.autoRenew.expired | boolean | ต่ออายุอัตโนมัติเมื่อหมดอายุ |
application.autoRenew.quota | boolean | ต่ออายุอัตโนมัติเมื่อโควต้าหมด |
application.autoRenew.createdAt | string | วันที่สร้าง (ISO 8601) |
application.autoRenew.expiresAt | string | วันหมดอายุ (ISO 8601) |
application.quota.used | number | โควต้าที่ใช้ไปในรอบนี้ |
application.quota.max | number | null | โควต้าสูงสุด (null = ไม่จำกัด) |
application.quota.remaining | number | null | โควต้าที่เหลือ |
application.quota.totalUsed | number | โควต้าที่ใช้ทั้งหมดตลอดการใช้งาน |
branch.name | string | ชื่อ Branch ปัจจุบัน |
branch.isActive | boolean | สถานะ Branch |
branch.quota.used | number | โควต้าที่ใช้ของ Branch |
branch.quota.totalUsed | number | โควต้ารวมที่ใช้ของ Branch |
account.email | string | อีเมลบัญชี |
account.credit | number | เครดิตที่มี |
product.name | string | ชื่อแพ็กเกจ |
Error Responses
ไม่ได้รับอนุญาต (401)
json
{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "Authorization header is required"
}
}API Key ไม่ถูกต้อง (401)
json
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid"
}
}Branch ไม่ได้เปิดใช้งาน (403)
json
{
"success": false,
"error": {
"code": "BRANCH_INACTIVE",
"message": "This API branch has been deactivated"
}
}หมายเหตุ
- Endpoint นี้ไม่หักโควต้า
- โควต้าจะรีเซ็ตทุกเดือนตามรอบบิล
max: nullหมายถึงโควต้าไม่จำกัดtotalUsedติดตามการใช้งานทั้งหมดตลอดทุกรอบบิล- โควต้า Branch ถูกติดตามแยกจากโควต้าแอปพลิเคชัน