ต้องใช้คีย์ API สำหรับคำขอที่ระบบจะประมวลผล เมื่อผู้ใช้ลงทะเบียนแล้ว คีย์ API จะถูกสร้างขึ้นโดยอัตโนมัติสำหรับผู้ใช้รายนี้ ต้องส่งคีย์ API ไปพร้อมกับคำขอแต่ละรายการ (ดูตัวอย่างแบบเต็มด้านล่าง) หากไม่ได้ส่งคีย์ API หรือหมดอายุ จะมีข้อผิดพลาด โปรดตรวจสอบให้แน่ใจว่าได้เก็บคีย์ API ของคุณเป็นความลับเพื่อป้องกันการละเมิด
ในการตรวจสอบสิทธิ์กับระบบ API คุณต้องส่งคีย์ API ของคุณเป็นโทเค็นการให้สิทธิ์กับแต่ละคำขอ คุณสามารถดูตัวอย่างโค้ดด้านล่าง
curl --location --request POST 'https://www.e.vg/api/url/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/url/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
API ของเรามีตัวจำกัดอัตราเพื่อป้องกันคำขอที่เพิ่มขึ้นอย่างรวดเร็วเพื่อเพิ่มความเสถียรสูงสุด ขณะนี้ตัวจำกัดอัตราของเราจำกัดไว้ที่ 3000 คำขอต่อ 1 นาที
ส่วนหัวหลายรายการจะถูกส่งไปพร้อมกับคำตอบ และสามารถตรวจสอบข้อมูลเหล่านี้เพื่อระบุข้อมูลต่างๆ เกี่ยวกับคำขอได้
X-RateLimit-Limit: 3000
X-RateLimit-Remaining: 2999
X-RateLimit-Reset: TIMESTAMP
การตอบสนอง API ทั้งหมดจะถูกส่งกลับในรูปแบบ JSON โดยค่าเริ่มต้น ในการแปลงข้อมูลนี้เป็นข้อมูลที่ใช้งานได้ จะต้องใช้ฟังก์ชันที่เหมาะสมตามภาษา ใน PHP สามารถใช้ฟังก์ชัน json_decode() เพื่อแปลงข้อมูลเป็นวัตถุ (ค่าเริ่มต้น) หรืออาร์เรย์ (ตั้งค่าพารามิเตอร์ที่สองเป็นจริง) การตรวจสอบรหัสข้อผิดพลาดเป็นสิ่งสำคัญมาก เนื่องจากให้ข้อมูลว่ามีข้อผิดพลาดหรือไม่ คุณยังสามารถตรวจสอบรหัสส่วนหัวได้
{
"error": 1,
"message": "An error ocurred"
}
https://www.e.vg/api/splash?limit=2&page=1
หากต้องการรับหน้าสแปลชที่กำหนดเองผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/splash?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"splash": [
{
"id": 1,
"name": "Product 1 Promo",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"name": "Product 2 Promo",
"date": "2020-11-10 18:10:00"
}
]
}
}
https://www.e.vg/api/qr?limit=2&page=1
ในการรับรหัส QR ของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/qr?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"qrs": [
{
"id": 2,
"link": "https:\/\/www.e.vg\/qr\/a2d5e",
"scans": 0,
"name": "Google",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"link": "https:\/\/www.e.vg\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
}
]
}
}
https://www.e.vg/api/qr/:id
หากต้องการดูรายละเอียดสำหรับรหัส QR เดียวผ่าน API คุณสามารถใช้ปลายทางนี้ได้
curl --location --request GET 'https://www.e.vg/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/qr/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"details": {
"id": 1,
"link": "https:\/\/www.e.vg\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
},
"data": {
"clicks": 1,
"uniqueClicks": 1,
"topCountries": {
"Unknown": "1"
},
"topReferrers": {
"Direct, email and other": "1"
},
"topBrowsers": {
"Chrome": "1"
},
"topOs": {
"Windows 10": "1"
},
"socialCount": {
"facebook": 0,
"twitter": 0,
"instagram": 0
}
}
}
https://www.e.vg/api/qr/add
ในการสร้างรหัส QR คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ POST ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
type | (จำเป็น) ข้อความ | vcard | ลิงค์ | อีเมล | โทรศัพท์ | sms | wifi |
data | (จำเป็น) ข้อมูลที่จะฝังอยู่ภายในรหัส QR ข้อมูลสามารถเป็นสตริงหรืออาร์เรย์ขึ้นอยู่กับประเภท |
background | (อุปกรณ์เสริม) สี RGB เช่น rgb(255,255,255) |
foreground | (อุปกรณ์เสริม) สี RGB เช่น rgb(0,0,0) |
logo | (ไม่บังคับ) เส้นทางไปยังโลโก้ png หรือ jpg |
curl --location --request POST 'https://www.e.vg/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/qr/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'type' => 'link',
'data' => 'https://google.com',
'background' => 'rgb(255,255,255)',
'foreground' => 'rgb(0,0,0)',
'logo' => 'https://site.com/logo.png',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"link": "https:\/\/www.e.vg\/qr\/a58f79"
}
https://www.e.vg/api/qr/:id/update
ในการอัปเดตรหัส QR คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
data | (จำเป็น) ข้อมูลที่จะฝังอยู่ภายในรหัส QR ข้อมูลสามารถเป็นสตริงหรืออาร์เรย์ขึ้นอยู่กับประเภท |
background | (อุปกรณ์เสริม) สี RGB เช่น rgb(255,255,255) |
foreground | (อุปกรณ์เสริม) สี RGB เช่น rgb(0,0,0) |
logo | (ไม่บังคับ) เส้นทางไปยังโลโก้ png หรือ jpg |
curl --location --request PUT 'https://www.e.vg/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/qr/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'type' => 'link',
'data' => 'https://google.com',
'background' => 'rgb(255,255,255)',
'foreground' => 'rgb(0,0,0)',
'logo' => 'https://site.com/logo.png',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "QR has been updated successfully."
}
https://www.e.vg/api/qr/:id/delete
หากต้องการลบรหัส QR คุณต้องส่งคำขอ DELETE
curl --location --request DELETE 'https://www.e.vg/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/qr/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "QR Code has been deleted successfully."
}
https://www.e.vg/api/channels?limit=2&page=1
ในการรับช่องของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/channels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"channels": [
{
"id": 1,
"name": "Channel 1",
"description": "Description of channel 1",
"color": "#000000",
"starred": true
},
{
"id": 2,
"name": "Channel 2",
"description": "Description of channel 2",
"color": "#FF0000",
"starred": false
}
]
}
}
https://www.e.vg/api/channel/:id?limit=1&page=1
หากต้องการรับรายการในช่องทางที่เลือกผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/channel/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channel/:id?limit=1&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"items": [
{
"type": "links",
"id": 1,
"title": "My Sample Link",
"preview": "https:\/\/google.com",
"link": "https:\/\/www.e.vg\/google",
"date": "2022-05-12"
},
{
"type": "bio",
"id": 1,
"title": "My Sample Bio",
"preview": "https:\/\/www.e.vg\/mybio",
"link": "https:\/\/www.e.vg\/mybio",
"date": "2022-06-01"
}
]
}
}
https://www.e.vg/api/channel/add
สามารถเพิ่มช่องสัญญาณได้โดยใช้จุดปลายนี้
พารามิเตอร์ | คำอธิบาย |
---|---|
name | (จำเป็น) ชื่อช่อง |
description | (ไม่บังคับ) คำอธิบายช่อง |
color | (ไม่บังคับ) สีป้ายช่อง (HEX) |
starred | (ไม่บังคับ) ติดดาวช่องหรือไม่ (จริงหรือเท็จ) |
curl --location --request POST 'https://www.e.vg/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'name' => 'New Channel',
'description' => 'my new channel',
'color' => '#000000',
'starred' => true,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}
https://www.e.vg/api/channel/:channelid/assign/:type/:itemid
สามารถกำหนดรายการให้กับช่องใดก็ได้โดยส่งคำขอด้วยรหัสช่อง ประเภทรายการ (ลิงก์ ประวัติหรือ qr) และรหัสรายการ
พารามิเตอร์ | คำอธิบาย |
---|---|
:channelid | (จำเป็น) รหัสช่อง |
:type | (จำเป็น) ลิงค์หรือประวัติหรือqr |
:itemid | (จำเป็น) รหัสสินค้า |
curl --location --request POST 'https://www.e.vg/api/channel/:channelid/assign/:type/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channel/:channelid/assign/:type/:itemid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Item successfully added to the channel."
}
https://www.e.vg/api/channel/:id/update
ในการอัปเดตช่อง คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
name | (ไม่บังคับ) ชื่อช่อง |
description | (ไม่บังคับ) คำอธิบายช่อง |
color | (ไม่บังคับ) สีป้ายช่อง (HEX) |
starred | (ไม่บังคับ) ติดดาวช่องหรือไม่ (จริงหรือเท็จ) |
curl --location --request PUT 'https://www.e.vg/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'name' => 'Acme Corp',
'description' => 'channel for items for Acme Corp',
'color' => '#FFFFFF',
'starred' => false,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Channel has been updated successfully."
}
https://www.e.vg/api/channel/:id/delete
หากต้องการลบช่อง คุณต้องส่งคำขอ DELETE รายการทั้งหมดจะถูกยกเลิกเช่นกัน
curl --location --request DELETE 'https://www.e.vg/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/channel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Channel has been deleted successfully."
}
https://www.e.vg/api/account
หากต้องการรับข้อมูลเกี่ยวกับบัญชี คุณสามารถส่งคำขอไปยังปลายทางนี้และจะส่งคืนข้อมูลในบัญชี
curl --location --request GET 'https://www.e.vg/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"data": {
"id": 1,
"email": "[email protected]",
"username": "sampleuser",
"avatar": "https:\/\/domain.com\/content\/avatar.png",
"status": "pro",
"expires": "2022-11-15 15:00:00",
"registered": "2020-11-10 18:01:43"
}
}
https://www.e.vg/api/account/update
หากต้องการอัปเดตข้อมูลในบัญชี คุณสามารถส่งคำขอไปยังปลายทางนี้และจะอัปเดตข้อมูลในบัญชี
curl --location --request PUT 'https://www.e.vg/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "newpassword"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/account/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'email' => '[email protected]',
'password' => 'newpassword',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Account has been successfully updated."
}
https://www.e.vg/api/pixels?limit=2&page=1
หากต้องการรับรหัสพิกเซลของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/pixels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"pixels": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GA-123456789",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "twitterpixel",
"name": "Twitter Pixel",
"tag": "1234567",
"date": "2020-11-10 18:10:00"
}
]
}
}
https://www.e.vg/api/pixel/add
สามารถสร้างพิกเซลได้โดยใช้จุดปลายนี้ คุณต้องส่งประเภทพิกเซลและแท็ก
พารามิเตอร์ | คำอธิบาย |
---|---|
type | (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok |
name | (จำเป็น) ชื่อที่กำหนดเองสำหรับพิกเซลของคุณ |
tag | (จำเป็น) แท็กสำหรับพิกเซล |
curl --location --request POST 'https://www.e.vg/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/pixel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'type' => 'gtmpixel',
'name' => 'My GTM',
'tag' => 'GTM-ABCDE',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 1
}
https://www.e.vg/api/pixel/:id/update
ในการอัปเดตพิกเซล คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
name | (ไม่บังคับ) ชื่อที่กำหนดเองสำหรับพิกเซลของคุณ |
tag | (จำเป็น) แท็กสำหรับพิกเซล |
curl --location --request PUT 'https://www.e.vg/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "My GTM",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/pixel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'name' => 'My GTM',
'tag' => 'GTM-ABCDE',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Pixel has been updated successfully."
}
https://www.e.vg/api/pixel/:id/delete
หากต้องการลบพิกเซล คุณต้องส่งคำขอ DELETE
curl --location --request DELETE 'https://www.e.vg/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/pixel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Pixel has been deleted successfully."
}
https://www.e.vg/api/urls?limit=2&page=1&order=date
ในการรับลิงก์ของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
order | (ไม่บังคับ) จัดเรียงข้อมูลระหว่างวันที่หรือคลิก |
curl --location --request GET 'https://www.e.vg/api/urls?limit=2&page=1&order=date' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/urls?limit=2&page=1&order=date",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"urls": [
{
"id": 2,
"alias": "google",
"shorturl": "https:\/\/www.e.vg\/google",
"longurl": "https:\/\/google.com",
"clicks": 0,
"title": "Google",
"description": "",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"alias": "googlecanada",
"shorturl": "https:\/\/www.e.vg\/googlecanada",
"longurl": "https:\/\/google.ca",
"clicks": 0,
"title": "Google Canada",
"description": "",
"date": "2020-11-10 18:00:25"
}
]
}
}
https://www.e.vg/api/url/:id
หากต้องการดูรายละเอียดสำหรับลิงก์เดียวผ่าน API คุณสามารถใช้จุดปลายนี้ได้
curl --location --request GET 'https://www.e.vg/api/url/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/url/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"details": {
"id": 1,
"shorturl": "https:\/\/www.e.vg\/googlecanada",
"longurl": "https:\/\/google.com",
"title": "Google",
"description": "",
"location": {
"canada": "https:\/\/google.ca",
"united states": "https:\/\/google.us"
},
"device": {
"iphone": "https:\/\/google.com",
"android": "https:\/\/google.com"
},
"expiry": null,
"date": "2020-11-10 18:01:43"
},
"data": {
"clicks": 0,
"uniqueClicks": 0,
"topCountries": 0,
"topReferrers": 0,
"topBrowsers": 0,
"topOs": 0,
"socialCount": {
"facebook": 0,
"twitter": 0,
"google": 0
}
}
}
https://www.e.vg/api/url/add
หากต้องการย่อลิงก์ คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ POST ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
url | (จำเป็น) URL ยาวเพื่อย่อ |
custom | (ไม่บังคับ) นามแฝงที่กำหนดเองแทนนามแฝงแบบสุ่ม |
type | (ไม่บังคับ) ประเภทการเปลี่ยนเส้นทาง [โดยตรง, เฟรม, สแปลช], เฉพาะ id สำหรับเพจสแปลชที่กำหนดเอง หรือ overlay-id สำหรับเพจ cta |
password | (ไม่บังคับ) การป้องกันด้วยรหัสผ่าน |
domain | (ไม่บังคับ) โดเมนที่กำหนดเอง |
expiry | (ไม่บังคับ) การหมดอายุสำหรับตัวอย่างลิงก์ 2021-09-28 23:11:16 |
geotarget | (ไม่บังคับ) ข้อมูลการกำหนดเป้าหมายตามภูมิศาสตร์ |
devicetarget | (ไม่บังคับ) ข้อมูลการกำหนดอุปกรณ์เป้าหมาย |
languagetarget | (ไม่บังคับ) ข้อมูลการกำหนดภาษาเป้าหมาย |
metatitle | (ไม่บังคับ) ชื่อเมตา |
metadescription | (ไม่บังคับ) คำอธิบายเมตา |
metaimage | (ไม่บังคับ) ลิงก์ไปยังรูปภาพ jpg หรือ png |
curl --location --request POST 'https://www.e.vg/api/url/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com"
},
{
"device": "Android",
"link": "https:\/\/google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https:\/\/google.com"
},
{
"language": "fr",
"link": "https:\/\/google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/url/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'url' => 'https://google.com',
'custom' => 'google',
'password' => 'mypass',
'expiry' => '2020-11-11 12:00:00',
'type' => 'splash',
'metatitle' => 'Not Google',
'metadescription' => 'Not Google description',
'metaimage' => 'https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png',
'geotarget' =>
array (
0 =>
array (
'location' => 'Canada',
'link' => 'https://google.ca',
),
1 =>
array (
'location' => 'United States',
'link' => 'https://google.us',
),
),
'devicetarget' =>
array (
0 =>
array (
'device' => 'iPhone',
'link' => 'https://google.com',
),
1 =>
array (
'device' => 'Android',
'link' => 'https://google.com',
),
),
'languagetarget' =>
array (
0 =>
array (
'language' => 'en',
'link' => 'https://google.com',
),
1 =>
array (
'language' => 'fr',
'link' => 'https://google.ca',
),
),
'parameters' =>
array (
0 =>
array (
'name' => 'aff',
'value' => '3',
),
1 =>
array (
'device' => 'gtm_source',
'link' => 'api',
),
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"shorturl": "https:\/\/www.e.vg\/google"
}
https://www.e.vg/api/url/:id/update
ในการอัปเดตลิงก์ คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
url | (จำเป็น) URL ยาวเพื่อย่อ |
custom | (ไม่บังคับ) นามแฝงที่กำหนดเองแทนนามแฝงแบบสุ่ม |
type | (ไม่บังคับ) ประเภทการเปลี่ยนเส้นทาง [โดยตรง, เฟรม, สแปลช] |
password | (ไม่บังคับ) การป้องกันด้วยรหัสผ่าน |
domain | (ไม่บังคับ) โดเมนที่กำหนดเอง |
expiry | (ไม่บังคับ) การหมดอายุสำหรับตัวอย่างลิงก์ 2021-09-28 23:11:16 |
geotarget | (ไม่บังคับ) ข้อมูลการกำหนดเป้าหมายตามภูมิศาสตร์ |
devicetarget | (ไม่บังคับ) ข้อมูลการกำหนดอุปกรณ์เป้าหมาย |
languagetarget | (ไม่บังคับ) ข้อมูลการกำหนดภาษาเป้าหมาย |
metatitle | (ไม่บังคับ) ชื่อเมตา |
metadescription | (ไม่บังคับ) คำอธิบายเมตา |
metaimage | (ไม่บังคับ) ลิงก์ไปยังรูปภาพ jpg หรือ png |
curl --location --request PUT 'https://www.e.vg/api/url/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"geotarget": [
{
"location": "Canada",
"link": "https:\/\/google.ca"
},
{
"location": "United States",
"link": "https:\/\/google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https:\/\/google.com"
},
{
"device": "Android",
"link": "https:\/\/google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/url/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'url' => 'https://google.com',
'custom' => 'google',
'password' => 'mypass',
'expiry' => '2020-11-11 12:00:00',
'type' => 'splash',
'geotarget' =>
array (
0 =>
array (
'location' => 'Canada',
'link' => 'https://google.ca',
),
1 =>
array (
'location' => 'United States',
'link' => 'https://google.us',
),
),
'devicetarget' =>
array (
0 =>
array (
'device' => 'iPhone',
'link' => 'https://google.com',
),
1 =>
array (
'device' => 'Android',
'link' => 'https://google.com',
),
),
'parameters' =>
array (
0 =>
array (
'name' => 'aff',
'value' => '3',
),
1 =>
array (
'device' => 'gtm_source',
'link' => 'api',
),
),
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"short": "https:\/\/www.e.vg\/google"
}
https://www.e.vg/api/url/:id/delete
หากต้องการลบลิงก์ คุณต้องส่งคำขอ DELETE
curl --location --request DELETE 'https://www.e.vg/api/url/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/url/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Link has been deleted successfully"
}
https://www.e.vg/api/campaigns?limit=2&page=1
ในการรับแคมเปญของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/campaigns?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/campaigns?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"campaigns": [
{
"id": 1,
"name": "Sample Campaign",
"public": false,
"rotator": false,
"list": "https:\/\/domain.com\/u\/admin\/list-1"
},
{
"id": 2,
"domain": "Facebook Campaign",
"public": true,
"rotator": "https:\/\/domain.com\/r\/test",
"list": "https:\/\/domain.com\/u\/admin\/test-2"
}
]
}
}
https://www.e.vg/api/campaign/add
คุณสามารถเพิ่มแคมเปญได้โดยใช้ปลายทางนี้
พารามิเตอร์ | คำอธิบาย |
---|---|
name | (ไม่บังคับ) ชื่อแคมเปญ |
slug | (อุปกรณ์เสริม) Rotator Slug |
public | (ไม่บังคับ) การเข้าถึง |
curl --location --request POST 'https://www.e.vg/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "New Campaign",
"slug": "new-campaign",
"public": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/campaign/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'name' => 'New Campaign',
'slug' => 'new-campaign',
'public' => true,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"domain": "New Campaign",
"public": true,
"rotator": "https:\/\/domain.com\/r\/new-campaign",
"list": "https:\/\/domain.com\/u\/admin\/new-campaign-3"
}
https://www.e.vg/api/campaign/:campaignid/assign/:linkid
สามารถกำหนดลิงก์สั้น ๆ ให้กับแคมเปญได้โดยใช้ปลายทางนี้ ปลายทางต้องมีรหัสแคมเปญและรหัสลิงก์แบบสั้น
curl --location --request POST 'https://www.e.vg/api/campaign/:campaignid/assign/:linkid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/campaign/:campaignid/assign/:linkid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Link successfully added to the campaign."
}
https://www.e.vg/api/campaign/:id/update
ในการอัปเดตแคมเปญ คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
name | (จำเป็น) ชื่อแคมเปญ |
slug | (อุปกรณ์เสริม) Rotator Slug |
public | (ไม่บังคับ) การเข้าถึง |
curl --location --request PUT 'https://www.e.vg/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Twitter Campaign",
"slug": "twitter-campaign",
"public": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/campaign/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'name' => 'Twitter Campaign',
'slug' => 'twitter-campaign',
'public' => true,
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 3,
"domain": "Twitter Campaign",
"public": true,
"rotator": "https:\/\/domain.com\/r\/twitter-campaign",
"list": "https:\/\/domain.com\/u\/admin\/twitter-campaign-3"
}
https://www.e.vg/api/campaign/:id/delete
หากต้องการลบแคมเปญ คุณต้องส่งคำขอ DELETE
curl --location --request DELETE 'https://www.e.vg/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/campaign/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Campaign has been deleted successfully."
}
https://www.e.vg/api/domains?limit=2&page=1
หากต้องการรับโดเมนที่มีตราสินค้าของคุณผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/domains?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"domains": [
{
"id": 1,
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
},
{
"id": 2,
"domain": "https:\/\/domain2.com",
"redirectroot": "https:\/\/rootdomain2.com",
"redirect404": "https:\/\/rootdomain2.com\/404"
}
]
}
}
https://www.e.vg/api/domain/add
คุณสามารถเพิ่มโดเมนได้โดยใช้ปลายทางนี้ โปรดตรวจสอบให้แน่ใจว่าโดเมนชี้ไปที่เซิร์ฟเวอร์ของเราอย่างถูกต้อง
พารามิเตอร์ | คำอธิบาย |
---|---|
domain | (จำเป็น) โดเมนของแบรนด์รวมถึง http หรือ https |
redirectroot | (ไม่บังคับ) รูทเปลี่ยนเส้นทางเมื่อมีผู้เยี่ยมชมโดเมนของคุณ |
redirect404 | (ไม่บังคับ) กำหนดเอง 404 เปลี่ยนเส้นทาง |
curl --location --request POST 'https://www.e.vg/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/domain/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'domain' => 'https://domain1.com',
'redirectroot' => 'https://rootdomain.com',
'redirect404' => 'https://rootdomain.com/404',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"id": 1
}
https://www.e.vg/api/domain/:id/update
ในการอัปเดตโดเมนของแบรนด์ คุณต้องส่งข้อมูลที่ถูกต้องใน JSON ผ่านคำขอ PUT ข้อมูลจะต้องถูกส่งเป็นเนื้อหาดิบของคำขอของคุณดังที่แสดงด้านล่าง ตัวอย่างด้านล่างแสดงพารามิเตอร์ทั้งหมดที่คุณสามารถส่งได้ แต่คุณไม่จำเป็นต้องส่งทั้งหมด (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
redirectroot | (ไม่บังคับ) รูทเปลี่ยนเส้นทางเมื่อมีผู้เยี่ยมชมโดเมนของคุณ |
redirect404 | (ไม่บังคับ) กำหนดเอง 404 เปลี่ยนเส้นทาง |
curl --location --request PUT 'https://www.e.vg/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/domain/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'redirectroot' => 'https://rootdomain-new.com',
'redirect404' => 'https://rootdomain-new.com/404',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Domain has been updated successfully."
}
https://www.e.vg/api/domain/:id/delete
หากต้องการลบโดเมน คุณต้องส่งคำขอ DELETE
curl --location --request DELETE 'https://www.e.vg/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/domain/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "Domain has been deleted successfully."
}
https://www.e.vg/api/overlay?limit=2&page=1
ในการรับการซ้อนทับ cta ผ่าน API คุณสามารถใช้จุดปลายนี้ได้ คุณยังสามารถกรองข้อมูล (ดูตารางสำหรับข้อมูลเพิ่มเติม)
พารามิเตอร์ | คำอธิบาย |
---|---|
limit | (ไม่บังคับ) ผลลัพธ์ข้อมูลต่อหน้า |
page | (ไม่บังคับ) คำขอหน้าปัจจุบัน |
curl --location --request GET 'https://www.e.vg/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/overlay?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"cta": [
{
"id": 1,
"type": "message",
"name": "Product 1 Promo",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "contact",
"name": "Contact Page",
"date": "2020-11-10 18:10:00"
}
]
}
}
ปลายทางนี้สามารถเข้าถึงได้โดยผู้ใช้ที่มีสิทธิ์ของผู้ดูแลระบบเท่านั้น
https://www.e.vg/api/users?filter=free
รับรายชื่อผู้ใช้ทั้งหมดบนแพลตฟอร์ม ข้อมูลสามารถกรองได้โดยส่งพารามิเตอร์ตัวกรองใน URL
พารามิเตอร์ | คำอธิบาย |
---|---|
filter | admin | ฟรี | มือโปร |
ค้นหาผู้ใช้ทางอีเมล |
curl --location --request GET 'https://www.e.vg/api/users?filter=free' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/users?filter=free",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"data": [
{
"id": 2,
"email": "[email protected]",
"username": "sample2user",
"avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
"status": "free",
"planid": 1,
"expires": null,
"registered": "2020-11-10 18:01:43",
"apikey": "ABC123DEF456"
},
{
"id": 1,
"email": "[email protected]",
"username": "sampleuser",
"avatar": "https:\\\/\\\/domain.com\/content\/avatar.png",
"status": "pro",
"planid": 2,
"expires": "2022-11-15 15:00:00",
"registered": "2020-11-10 18:01:43",
"apikey": "ABC123DEF456"
}
]
}
https://www.e.vg/api/user/:id
รับข้อมูลสำหรับผู้ใช้คนเดียว
curl --location --request GET 'https://www.e.vg/api/user/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/user/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"data": {
"id": 2,
"email": "[email protected]",
"username": "sample2user",
"avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
"status": "free",
"planid": 1,
"expires": null,
"registered": "2020-11-10 18:01:43",
"apikey": "ABC123DEF456"
}
}
https://www.e.vg/api/user/add
ในการสร้างผู้ใช้ ให้ใช้จุดปลายนี้และส่งข้อมูลต่อไปนี้เป็น JSON
พารามิเตอร์ | คำอธิบาย |
---|---|
username | (จำเป็น) ชื่อผู้ใช้ของผู้ใช้ จำเป็นต้องถูกต้อง |
(จำเป็น) อีเมลของผู้ใช้ จำเป็นต้องถูกต้อง | |
password | (จำเป็น) รหัสผ่านของผู้ใช้ ขั้นต่ำ 5 ตัวอักษร |
planid | (ไม่บังคับ) แผนพรีเมียม สามารถพบได้ในแผงการดูแลระบบ |
expiration | (ไม่บังคับ) ตัวอย่างการหมดอายุสมาชิก 2020-12-26 12:00:00 |
curl --location --request POST 'https://www.e.vg/api/user/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "user",
"password": "1234567891011",
"email": "[email protected]",
"planid": 1,
"expiration": "2020-11-20 11:00:00"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/user/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'username' => 'user',
'password' => '1234567891011',
'email' => '[email protected]',
'planid' => 1,
'expiration' => '2020-11-20 11:00:00',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "User has been registered.",
"data": {
"id": 3,
"email": "[email protected]",
"username": "user"
}
}
https://www.e.vg/api/user/:id/delete
หากต้องการลบผู้ใช้ ให้ใช้ปลายทางนี้
curl --location --request DELETE 'https://www.e.vg/api/user/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/user/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "User has been deleted."
}
https://www.e.vg/api/user/login/:id
ปลายทางนี้จะสร้างลิงก์เฉพาะที่จะให้ผู้ใช้ลงชื่อเข้าใช้แพลตฟอร์มได้โดยอัตโนมัติ URL การเข้าสู่ระบบ SSO มีอายุ 1 ชั่วโมงและสามารถใช้ได้ครั้งเดียว
curl --location --request GET 'https://www.e.vg/api/user/login/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/user/login/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"url": "https:\/\/www.e.vg\/user\/login\/sso\/rnsuucafvifvqmhkjnvcvktxrkosstex"
}
ปลายทางนี้สามารถเข้าถึงได้โดยผู้ใช้ที่มีสิทธิ์ของผู้ดูแลระบบเท่านั้น
https://www.e.vg/api/plans
รับรายการแผนทั้งหมดบนแพลตฟอร์ม
curl --location --request GET 'https://www.e.vg/api/plans' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"data": [
{
"id": 2,
"name": "Business",
"free": false,
"prices": {
"monthly": 9.99,
"yearly": 99.99,
"lifetime": 999.99
},
"limits": {
"links": 100,
"clicks": 100000,
"retention": 60,
"custom": {
"enabled": "0"
},
"team": {
"enabled": "0",
"count": "0"
},
"splash": {
"enabled": "1",
"count": "5"
},
"overlay": {
"enabled": "1",
"count": "10"
},
"pixels": {
"enabled": "1",
"count": "10"
},
"domain": {
"enabled": "1",
"count": "1"
},
"multiple": {
"enabled": "0"
},
"alias": {
"enabled": "1"
},
"device": {
"enabled": "0"
},
"geo": {
"enabled": "0"
},
"bundle": {
"enabled": "0"
},
"parameters": {
"enabled": "0"
},
"export": {
"enabled": "0"
},
"api": {
"enabled": "0"
}
}
},
{
"id": 1,
"name": "Starter",
"free": true,
"prices": null,
"limits": {
"links": 10,
"clicks": 1000,
"retention": 7,
"custom": {
"enabled": "0"
},
"team": {
"enabled": "0",
"count": "0"
},
"splash": {
"enabled": "0",
"count": "0"
},
"overlay": {
"enabled": "0",
"count": "10"
},
"pixels": {
"enabled": "0",
"count": "10"
},
"domain": {
"enabled": "0",
"count": "0"
},
"multiple": {
"enabled": "0"
},
"alias": {
"enabled": "0"
},
"device": {
"enabled": "0"
},
"geo": {
"enabled": "0"
},
"bundle": {
"enabled": "0"
},
"parameters": {
"enabled": "0"
},
"export": {
"enabled": "0"
},
"api": {
"enabled": "0"
}
}
}
]
}
https://www.e.vg/api/plan/:planid/user/:userid
ในการสมัครผู้ใช้เพื่อวางแผน ให้ส่งคำขอ PUT ไปยังปลายทางนี้ด้วยรหัสแผนและรหัสผู้ใช้ ต้องระบุประเภทการสมัครและวันหมดอายุ หากไม่ระบุวันหมดอายุ วันที่จะถูกปรับตามประเภท
พารามิเตอร์ | คำอธิบาย |
---|---|
type | รายเดือน | รายปี | ตลอดชีพ |
expiration | (ไม่บังคับ) วันหมดอายุของแผนเช่น2025-02-17 03:06:48 |
curl --location --request PUT 'https://www.e.vg/api/plan/:planid/user/:userid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "monthly",
"expiration": "2025-02-17 03:06:48"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.e.vg/api/plan/:planid/user/:userid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
),
CURLOPT_POSTFIELDS => json_encode(array (
'type' => 'monthly',
'expiration' => '2025-02-17 03:06:48',
)),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"error": 0,
"message": "User has been subscribed to this plan."
}