Skip to content

ข้อมูลแอปพลิเคชัน

ดูข้อมูลเกี่ยวกับแอปพลิเคชัน, การใช้โควต้า และสถานะ Subscription

Endpoint

http
GET /me

URL เต็ม: https://developer.easyslip.com/api/v1/me

การยืนยันตัวตน

จำเป็น ดูคู่มือการยืนยันตัวตน

http
Authorization: Bearer YOUR_API_KEY

Request

ไม่ต้องมี 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

ฟิลด์ประเภทคำอธิบาย
applicationstringชื่อแอปพลิเคชัน
usedQuotanumberโควต้าที่ใช้ไปในรอบนี้
maxQuotanumber | nullโควต้าสูงสุด (null = ไม่จำกัด)
remainingQuotanumber | nullโควต้าที่เหลือ
expiredAtstringวันหมดอายุ Subscription (ISO 8601)
currentCreditnumberเครดิตที่มี

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 หมายถึงโควต้าไม่จำกัด
  • เครดิตใช้สำหรับการต่ออายุอัตโนมัติและฟีเจอร์เสริม

Bank Slip Verification API for Thai Banking