开发人员 API 参考 v3

入门

系统处理请求需要 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 有一个速率限制器来防止请求激增,以最大限度地提高其稳定性。 我们的速率限制器目前的上限为每 1 分钟 3000 个请求。

几个标头将与响应一起发送,可以检查这些标头以确定有关请求的各种信息。

X-RateLimit-Limit: 3000
X-RateLimit-Remaining: 2999
X-RateLimit-Reset: TIMESTAMP
响应处理

默认情况下,所有 API 响应都以 JSON 格式返回。 要将其转换为可用数据,需要根据语言使用适当的函数。 在 PHP 中,函数 json_decode() 可用于将数据转换为对象(默认)或数组(将第二个参数设置为 true)。 检查错误键非常重要,因为它提供了有关是否存在错误的信息。 您还可以检查标题代码。

{
    "error": 1,
    "message": "An error ocurred"
}

CTA 叠加层

列出 CTA 叠加层
GET https://www.e.vg/api/overlay?limit=2&page=1

要通过 API 获取 cta 覆盖,您可以使用此接口。 您还可以过滤数据(请参阅表格了解更多信息)。

范围描述
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"
            }
        ]
    }
}

二维码

列出二维码
GET https://www.e.vg/api/qr?limit=2&page=1

要通过 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"
            }
        ]
    }
}
获取一个二维码
GET https://www.e.vg/api/qr/:id

要通过 API 获取单个 QR 码的详细信息,您可以使用此接口。

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
        }
    }
}
创建二维码
POST https://www.e.vg/api/qr/add

要创建二维码,您需要通过 POST 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(请参阅表格了解更多信息)。

范围描述
type (必填)文本 | 电子名片 | 链接 | 电子邮件 | 电话 | 短信 | 无线上网
data (必填)要嵌入二维码的数据。 数据可以是字符串或数组,具体取决于类型
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"
}
更新二维码
PUT https://www.e.vg/api/qr/:id/update

要更新二维码,您需要通过 PUT 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(请参阅表格了解更多信息)。

范围描述
data (必填)要嵌入二维码的数据。 数据可以是字符串或数组,具体取决于类型
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."
}
删除二维码
DELETE 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."
}

像素

像素列表
GET 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"
            }
        ]
    }
}
创建像素
POST 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
}
更新像素
PUT https://www.e.vg/api/pixel/:id/update

要更新像素,您需要通过 PUT 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(请参阅表格了解更多信息)。

范围描述
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."
}
删除像素
DELETE 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."
}

品牌域名

列出品牌域名
GET 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"
            }
        ]
    }
}
创建品牌域
POST 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
}
更新域
PUT https://www.e.vg/api/domain/:id/update

要更新品牌域,您需要通过 PUT 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(请参阅表格了解更多信息)。

范围描述
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."
}
删除域
DELETE 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."
}

帐户

获取帐户
GET 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"
    }
}
更新账户
PUT 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."
}

活动

活动列表
GET 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"
            }
        ]
    }
}
创建活动
POST https://www.e.vg/api/campaign/add

可以使用此接口添加活动。

范围描述
name (可选)广告系列名称
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"
}
为活动分配链接
POST https://www.e.vg/api/campaign/:campaignid/assign/:linkid

可以使用此接口将短链接分配给活动。 接口需要活动 ID 和短链接 ID。

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."
}
更新活动
PUT https://www.e.vg/api/campaign/:id/update

要更新活动,您需要通过 PUT 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(请参阅表格了解更多信息)。

范围描述
name (必填)广告系列名称
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"
}
删除活动
DELETE 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."
}

自定义中间页

自定义中间页列表
GET 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"
            }
        ]
    }
}

链接


频道

频道列表
GET 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
            }
        ]
    }
}
列出频道项目
GET 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"
            }
        ]
    }
}
创建频道
POST 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
}
将项目分配给频道
POST https://www.e.vg/api/channel/:channelid/assign/:type/:itemid

可以通过发送带有频道 ID、项目类型(链接、生物或 qr)和项目 ID 的请求,将项目分配给任何频道。

范围描述
:channelid (必填)频道 ID
:type (必填)链接或简介历或 qr
:itemid (必填)项目 ID
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."
}
更新频道
PUT https://www.e.vg/api/channel/:id/update

要更新频道,您需要通过 PUT 请求以 JSON 格式发送有效数据。 数据必须作为请求的原始正文发送,如下所示。 下面的示例显示了您可以发送的所有参数,但您不需要全部发送(参见表格了解更多信息)。

范围描述
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."
}
删除频道
DELETE 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."
}

用户

此接口只能由具有管理员权限的用户访问。

列出用户
GET https://www.e.vg/api/users?filter=free

获取平台上所有用户的列表。 可以通过在 url 中发送过滤参数来过滤数据。

范围描述
filter 管理员 | 免费 | 专业版
email 通过电子邮件搜索用户
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"
        }
    ]
}
列出单个用户
GET 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"
    }
}
创建用户
POST https://www.e.vg/api/user/add

要创建用户,请使用此接口并将以下信息作为 JSON 发送。

范围描述
username (必填)用户的用户名。 需要有效。
email (必填)用户的电子邮件。 需要有效。
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"
    }
}
删除用户
DELETE 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."
}
登录用户
GET https://www.e.vg/api/user/login/:id

该接口将生成一个唯一链接,允许用户自动登录平台。 SSO 登录 url 有效期为 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\/hlokpwtxpspubzexydjxvoxpfbjwicyh"
}

计划

此接口只能由具有管理员权限的用户访问。

列出计划
GET 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"
                }
            }
        }
    ]
}
为用户订阅计划
PUT https://www.e.vg/api/plan/:planid/user/:userid

要为用户订阅计划,请使用计划 ID 和用户 ID 向此接口发送 PUT 请求。 需要指定订阅类型和到期日期。 如果未指定到期日期,则日期将根据类型进行调整。

范围描述
type 每月 | 每年 | 永久
expiration (可选)计划的到期日期,例如2024-05-25 17:38:52
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": "2024-05-25 17:38:52"
}'
$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' => '2024-05-25 17:38:52',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
服务器响应
{
    "error": 0,
    "message": "User has been subscribed to this plan."
}