API ขายโปรแกรม ช่วยทำการตลาดออนไลน์อัตโนมัติ

Automated marketing programs
เข้าสู่ระบบ
ข้อมูล API

ใช้ API นี้ในการซื้อโปรแกรม, ต่ออายุ Key เดิม และย้ายเครื่องแบบอัตโนมัติ

รองรับการเชื่อมต่อจากระบบภายนอก เช่น เว็บของคุณเอง, ระบบหลังบ้าน หรือสคริปต์อัตโนมัติ

JSON POST Private API
API Key สำหรับโปรแกรม
ใช้ API Key นี้ในการยืนยันตัวตนทุกครั้ง
กรุณาเข้าสู่ระบบก่อน เพื่อใช้ API และสร้าง API Key สำหรับโปรแกรม
Authentication

หมายเหตุ: Endpoint getprograms ไม่ต้องใช้ API Key ส่วน endpoint อื่นๆ ต้องส่ง API Key ผ่านพารามิเตอร์ key แบบ POST

  • HTTP Method: POST
  • Content-Type: application/x-www-form-urlencoded หรือ multipart/form-data
  • API URL: https://www.adsproth.com/key/api_programs

ตัวอย่าง Request เบื้องต้น

POST https://www.adsproth.com/key/api_programs

key=YOUR_API_KEY_PROGRAM
action=buyprogram
type=autowarmvip
day=30
ip=1.2.3.4
ตัวอย่างการใช้งาน API ด้วย PHP

ตัวอย่างโค้ด PHP สำหรับเรียกใช้ API แบบฟังก์ชัน:

<?php
class ProgramAPI {
    private $url = 'https://www.adsproth.com/key/api_programs';
    private $key;

    function __construct($key = '') {
        $this->key = $key;
    }

    private function call($data) {
        $ch = curl_init($this->url);
        curl_setopt_array($ch, [
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => http_build_query($data),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false
        ]);
        $res = curl_exec($ch);
        $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        $json = json_decode($res, true);
        return ($code == 200 && ($json['status'] ?? false)) ? $json : false;
    }

    // API methods
    function programs() {
        return $this->call(['action' => 'getprograms']);
    }

    function buy($type, $day, $name = '', $ip = '') {
        return $this->call(array_filter([
            'key' => $this->key,
            'action' => 'buyprogram',
            'type' => $type,
            'day' => $day,
            'key_name' => $name,
            'ip' => $ip
        ]));
    }

    function renew($pkey) {
        return $this->call([
            'key' => $this->key,
            'action' => 'renewkey',
            'p_key' => $pkey
        ]);
    }

    function move($pkey) {
        return $this->call([
            'key' => $this->key,
            'action' => 'movecomputer',
            'p_key' => $pkey
        ]);
    }

    function history($limit = 50) {
        return $this->call([
            'key' => $this->key,
            'action' => 'gethistory',
            'limit' => $limit
        ]);
    }

    function balance() {
        return $this->call([
            'key' => $this->key,
            'action' => 'getbalance'
        ]);
    }
}

$api = new ProgramAPI('YOUR_API_KEY');

// ดึงโปรแกรม
$programs = $api->programs();
print_r($programs);

// ซื้อโปรแกรม
$buy = $api->buy('autowarmvip', '30', 'Key ลูกค้า A', $_SERVER['REMOTE_ADDR']);
print_r($buy);

// ต่ออายุ (ระบบจะใช้ราคาและจำนวนวันเดิมจากฐานข้อมูล)
$renew = $api->renew('XXXX-XXXX');
print_r($renew);

// ย้ายเครื่อง
$api->move('XXXX-XXXX');

// ประวัติ
$history = $api->history(20);
print_r($history);

// เช็คยอดเงิน
$balance = $api->balance();
print_r($balance);

?>
หมายเหตุ:
  • เปลี่ยน YOUR_API_KEY_PROGRAM เป็น API Key จริงของคุณ
  • เปลี่ยน autowarmvip เป็นรหัสโปรแกรมที่ต้องการซื้อ
  • Class นี้รวมฟังก์ชันทั้งหมดไว้ในที่เดียว ใช้งานง่ายและสะดวก
  • ทุกฟังก์ชันจะ return array ที่มี success, data, และ http_code
  • ตรวจสอบ $result['success'] ก่อนใช้งานข้อมูล
Endpoints

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
action Yes getprograms คำสั่งดึงรายการโปรแกรม

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "ดึงข้อมูลโปรแกรมสำเร็จ",
  "total": 5,
  "programs": [
    {
      "id": 1,
      "name": "Auto Warm VIP",
      "img": "https://example.com/image.jpg",
      "desc": "รายละเอียดโปรแกรม",
      "type": "autowarmvip",
      "limit_login": 3,
      "link_download": "https://example.com/download",
      "version": "1.0.0",
      "prices": {
        "day_3": 285.00,
        "day_7": 630.00,
        "day_15": 1275.00,
        "day_30": 2400.00,
        "lifetime": 7200.00
      }
    }
  ]
}

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
key Yes YOUR_API_KEY_PROGRAM API Key สำหรับโปรแกรม
action Yes buyprogram คำสั่งซื้อโปรแกรม
type Yes autowarmvip รหัสโปรแกรม
day Yes 30 จำนวนวันใช้งาน (3 = 3 วัน, 7 = 7 วัน, 15 = 15 วัน, 30 = 31 วัน, lifetime = ตลอดชีพ)
ip No 1.2.3.4 IP ลูกค้า (ถ้าไม่ส่ง ระบบจะใช้ IP จาก server)
key_name No Key สำหรับลูกค้า A ชื่อ Key ที่ต้องการกำหนด (ถ้าไม่ส่งจะไม่กำหนดชื่อ Key - เหมือนการซื้อปกติ)
ชื่อ Key จะแสดงในหน้า License ในโปรแกรม

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "สั่งซื้อสำเร็จ",
  "p_key": "xxxxxxxxxxxx",
  "end_date": "2025-01-01"
}

ตัวอย่าง Response (เงินไม่พอ):

{
  "status": false,
  "message": "เงินของท่านไม่เพียงพอ กรุณาเติมเงิน..."
}

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
key Yes YOUR_API_KEY_PROGRAM API Key สำหรับโปรแกรม
action Yes renewkey คำสั่งต่ออายุ Key
p_key Yes xxxxxxxxxxxx Key ของโปรแกรมที่ต้องการต่ออายุ
หมายเหตุสำคัญ:
  • ระบบจะใช้ราคาเดิม (p_ratebuy) และจำนวนวันเดิม (p_day) จากฐานข้อมูลอัตโนมัติ
  • ไม่ต้องส่ง day parameter - ระบบจะต่ออายุด้วยแพ็คเกจและราคาเดียวกับที่ซื้อครั้งแรก
  • ถ้า Key หมดอายุแล้ว ระบบจะเริ่มนับจากวันนี้ ถ้ายังไม่หมดอายุจะนับต่อจากวันที่หมดอายุเดิม

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "ต่ออายุสำเร็จ",
  "new_end_date": "2025-02-01",
  "key": "xxxxxxxxxxxx",
  "key_name": "TEST101",
  "days": 30
}

รายละเอียด Fields:

  • new_end_date: วันที่หมดอายุใหม่ (Y-m-d)
  • key: Key ของโปรแกรม
  • key_name: ชื่อ Key
  • days: จำนวนวันที่ต่ออายุ

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
key Yes YOUR_API_KEY_PROGRAM API Key สำหรับโปรแกรม
action Yes movecomputer คำสั่งย้ายเครื่อง
p_key Yes xxxxxxxxxxxx Key ของโปรแกรมที่ต้องการย้ายเครื่อง

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "ย้ายเครื่องสำเร็จ (ลบเครื่องปัจจุบันแล้ว) กรุณาลงทะเบียนเครื่องใหม่",
  "key": "xxxxxxxxxxxx",
  "key_name": "Key สำหรับลูกค้า A"
}

รายละเอียด Fields:

  • key: Key ของโปรแกรมที่ย้ายเครื่อง
  • key_name: ชื่อ Key

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
key Yes YOUR_API_KEY_PROGRAM API Key สำหรับโปรแกรม
action Yes gethistory คำสั่งดูประวัติการสั่งซื้อ
limit No 50 จำนวนรายการต่อหน้า (default: 50, สูงสุด: 100)
offset No 0 จำนวนรายการที่ข้าม (default: 0, สำหรับ การแบ่งหน้า)
search No autowarmvip ค้นหาจากชื่อโปรแกรม, Key หรือชื่อ Key (optional)

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "ดึงประวัติการสั่งซื้อสำเร็จ",
  "orders": [
    {
      "id": 123,
      "name": "Auto Warm VIP",
      "img": "https://example.com/image.png",
      "key": "xxxxxxxxxxxx",
      "key_name": "Key #123",
      "type": "autowarmvip",
      "price": 500.00,
      "start_date": "2025-01-01",
      "end_date": "2025-01-31",
      "order_date": "2025-01-01 10:00:00",
      "status": "active",
      "status_text": "ใช้งานได้",
      "days_remaining": 15,
      "has_computer": true,
      "purchased_by": "API xxxxxxxxxxxx"
    }
  ],
  "total": 10,
  "limit": 50,
  "offset": 0,
  "has_more": false
}

รายละเอียด Fields:

  • id: ID ของรายการสั่งซื้อ
  • name: ชื่อโปรแกรม
  • img: URL รูปภาพโปรแกรม
  • key: Key ของโปรแกรม
  • key_name: ชื่อ Key
  • type: รหัสโปรแกรม
  • price: ราคาที่ซื้อ
  • start_date: วันที่เริ่มใช้งาน
  • end_date: วันที่หมดอายุ
  • order_date: วันที่สั่งซื้อ
  • status: สถานะ (active, warning, lifetime, expired)
  • status_text: ข้อความสถานะ
  • days_remaining: จำนวนวันคงเหลือ
  • has_computer: มีการผูกเครื่องหรือไม่
  • purchased_by: ซื้อผ่านช่องทางใด

URL: https://www.adsproth.com/key/api_programs

Method: POST

Parameters:

ชื่อ จำเป็น ตัวอย่าง คำอธิบาย
key Yes YOUR_API_KEY_PROGRAM API Key สำหรับโปรแกรม
action Yes getbalance คำสั่งเช็คยอดเงิน

ตัวอย่าง Response (สำเร็จ):

{
  "status": true,
  "message": "ดึงยอดเงินสำเร็จ",
  "balance": 5000.00,
  "currency": "THB",
  "email": "[email protected]"
}