Một khóa API là cần thiết để các yêu cầu được hệ thống xử lý. Sau khi đăng ký, một khóa API sẽ được tự động tạo cho người dùng. Khóa API phải được gửi kèm mỗi yêu cầu (xem ví dụ đầy đủ bên dưới). Nếu không gửi khóa API hoặc khóa API đã hết hạn, sẽ xảy ra lỗi. Vui lòng giữ bí mật khóa API của bạn để tránh lạm dụng.
Để xác thực với hệ thống API, bạn cần gửi khóa API của mình dưới dạng token xác thực với mỗi yêu cầu. Xem ví dụ mã bên dưới.
curl --location --request POST 'https://linkrutgon.vn/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/account',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: ''
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
API của chúng tôi có giới hạn tần suất để bảo vệ khỏi các đợt tăng đột biến yêu cầu, nhằm tối đa hóa sự ổn định. Hiện tại, giới hạn này được đặt ở mức 30 yêu cầu mỗi 1 phút.
Một số header sẽ được gửi kèm theo phản hồi, bạn có thể kiểm tra chúng để xác định các thông tin liên quan đến yêu cầu.
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: TIMESTAMP
Tất cả phản hồi API mặc định được trả về ở định dạng JSON. Để chuyển đổi dữ liệu này thành dữ liệu có thể sử dụng được, cần sử dụng hàm phù hợp theo ngôn ngữ lập trình. Trong PHP, hàm json_decode() có thể được sử dụng để chuyển đổi dữ liệu thành đối tượng (mặc định) hoặc mảng (thiết lập tham số thứ hai là true). Điều rất quan trọng là kiểm tra khóa error để biết thông tin có xảy ra lỗi hay không. Bạn cũng có thể kiểm tra mã header.
{
"error": 1,
"message": "Đã xảy ra lỗi"
}
https://linkrutgon.vn/api/campaigns?limit=2&page=1
Để lấy danh sách chiến dịch của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/campaigns?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/campaigns?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"campaigns": [
{
"id": 1,
"name": "Chi\u1ebfn d\u1ecbch M\u1eabu",
"public": false,
"rotator": false,
"list": "https:\/\/domain.com\/u\/admin\/list-1"
},
{
"id": 2,
"domain": "Chi\u1ebfn d\u1ecbch Facebook",
"public": true,
"rotator": "https:\/\/domain.com\/r\/test",
"list": "https:\/\/domain.com\/u\/admin\/test-2"
}
]
}
}
https://linkrutgon.vn/api/campaign/add
Bạn có thể thêm một chiến dịch bằng cách sử dụng endpoint này.
Tham số | Mô tả |
---|---|
name | (tùy chọn) Tên chiến dịch |
slug | (tùy chọn) Định danh Rotator |
public | (tùy chọn) Quyền truy cập |
curl --location --request POST 'https://linkrutgon.vn/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Chi\u1ebfn d\u1ecbch M\u1edbi",
"slug": "chien-dich-moi",
"public": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/campaign/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Chi\u1ebfn d\u1ecbch M\u1edbi",
"slug": "chien-dich-moi",
"public": true
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/campaign/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Chi\u1ebfn d\u1ecbch M\u1edbi",
"slug": "chien-dich-moi",
"public": true
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"domain": "Chi\u1ebfn d\u1ecbch M\u1edbi",
"public": true,
"rotator": "https:\/\/domain.com\/r\/chien-dich-moi",
"list": "https:\/\/domain.com\/u\/admin\/chien-dich-moi-3"
}
https://linkrutgon.vn/api/campaign/:campaignid/assign/:linkid
Một liên kết rút gọn có thể được gán vào một chiến dịch bằng cách sử dụng endpoint này. Endpoint yêu cầu ID của chiến dịch và ID của liên kết rút gọn.
curl --location --request POST 'https://linkrutgon.vn/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://linkrutgon.vn/api/campaign/:campaignid/assign/:linkid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/campaign/:campaignid/assign/:linkid',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Li\u00ean k\u1ebft \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam v\u00e0o chi\u1ebfn d\u1ecbch th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/campaign/:id/update
Để cập nhật một chiến dịch, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
name | (bắt buộc) Tên chiến dịch |
slug | (tùy chọn) Định danh Rotator |
public | (tùy chọn) Quyền truy cập |
curl --location --request PUT 'https://linkrutgon.vn/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Chi\u1ebfn d\u1ecbch Twitter",
"slug": "chien-dich-twitter",
"public": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/campaign/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Chi\u1ebfn d\u1ecbch Twitter",
"slug": "chien-dich-twitter",
"public": true
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/campaign/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Chi\u1ebfn d\u1ecbch Twitter",
"slug": "chien-dich-twitter",
"public": true
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"domain": "Chi\u1ebfn d\u1ecbch Twitter",
"public": true,
"rotator": "https:\/\/domain.com\/r\/chien-dich-twitter",
"list": "https:\/\/domain.com\/u\/admin\/chien-dich-twitter-3"
}
https://linkrutgon.vn/api/campaign/:id/delete
Để xóa một chiến dịch, bạn cần gửi một yêu cầu DELETE.
curl --location --request DELETE 'https://linkrutgon.vn/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/campaign/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/campaign/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Chi\u1ebfn d\u1ecbch \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/channels?limit=2&page=1
Để lấy danh sách kênh của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/channels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/channels?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"channels": [
{
"id": 1,
"name": "K\u00eanh 1",
"description": "M\u00f4 t\u1ea3 c\u1ee7a k\u00eanh 1",
"color": "#000000",
"starred": true
},
{
"id": 2,
"name": "K\u00eanh 2",
"description": "M\u00f4 t\u1ea3 c\u1ee7a k\u00eanh 2",
"color": "#FF0000",
"starred": false
}
]
}
}
https://linkrutgon.vn/api/channel/:id?limit=1&page=1
Để lấy dữ liệu từ một kênh đã chọn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/channel/:id?limit=1&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/channel/:id?limit=1&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"items": [
{
"type": "li\u00ean k\u1ebft",
"id": 1,
"title": "Li\u00ean k\u1ebft M\u1eabu c\u1ee7a T\u00f4i",
"preview": "https:\/\/google.com",
"link": "https:\/\/linkrutgon.vn\/google",
"date": "2022-05-12"
},
{
"type": "ti\u1ec3u s\u1eed",
"id": 1,
"title": "Ti\u1ec3u s\u1eed M\u1eabu c\u1ee7a T\u00f4i",
"preview": "https:\/\/linkrutgon.vn\/mybio",
"link": "https:\/\/linkrutgon.vn\/mybio",
"date": "2022-06-01"
}
]
}
}
https://linkrutgon.vn/api/channel/add
Bạn có thể thêm một kênh bằng cách sử dụng endpoint này.
Tham số | Mô tả |
---|---|
name | (bắt buộc) Tên kênh |
description | (tùy chọn) Mô tả kênh |
color | (tùy chọn) Màu biểu tượng kênh (HEX) |
starred | (tùy chọn) Gắn dấu sao cho kênh hay không (true hoặc false) |
curl --location --request POST 'https://linkrutgon.vn/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "K\u00eanh M\u1edbi",
"description": "m\u00f4 t\u1ea3 k\u00eanh m\u1edbi",
"color": "#000000",
"starred": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/channel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "K\u00eanh M\u1edbi",
"description": "m\u00f4 t\u1ea3 k\u00eanh m\u1edbi",
"color": "#000000",
"starred": true
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/channel/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "K\u00eanh M\u1edbi",
"description": "m\u00f4 t\u1ea3 k\u00eanh m\u1edbi",
"color": "#000000",
"starred": true
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"name": "K\u00eanh M\u1edbi",
"description": "m\u00f4 t\u1ea3 k\u00eanh m\u1edbi",
"color": "#000000",
"starred": true
}
https://linkrutgon.vn/api/channel/:channelid/assign/:type/:itemid
Một mục có thể được gán vào bất kỳ kênh nào bằng cách gửi yêu cầu kèm theo ID kênh, loại mục (liên kết, tiểu sử hoặc QR) và ID mục.
Tham số | Mô tả |
---|---|
:channelid | (bắt buộc) ID của kênh |
:type | (bắt buộc) liên kết hoặc tiểu sử hoặc QR |
:itemid | (bắt buộc) ID của mục |
curl --location --request POST 'https://linkrutgon.vn/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://linkrutgon.vn/api/channel/:channelid/assign/:type/:itemid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/channel/:channelid/assign/:type/:itemid',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "M\u1ee5c \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00eam v\u00e0o k\u00eanh th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/channel/:id/update
Để cập nhật một kênh, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
name | (tùy chọn) Tên kênh |
description | (tùy chọn) Mô tả kênh |
color | (tùy chọn) Màu biểu tượng kênh (HEX) |
starred | (tùy chọn) Gắn dấu sao cho kênh hay không (true hoặc false) |
curl --location --request PUT 'https://linkrutgon.vn/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Acme Corp",
"description": "k\u00eanh d\u00e0nh cho c\u00e1c m\u1ee5c c\u1ee7a Acme Corp",
"color": "#FFFFFF",
"starred": false
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/channel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Acme Corp",
"description": "k\u00eanh d\u00e0nh cho c\u00e1c m\u1ee5c c\u1ee7a Acme Corp",
"color": "#FFFFFF",
"starred": false
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/channel/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Acme Corp",
"description": "k\u00eanh d\u00e0nh cho c\u00e1c m\u1ee5c c\u1ee7a Acme Corp",
"color": "#FFFFFF",
"starred": false
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "K\u00eanh \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/channel/:id/delete
Để xóa một kênh, bạn cần gửi một yêu cầu DELETE. Tất cả các mục cũng sẽ được gỡ khỏi kênh.
curl --location --request DELETE 'https://linkrutgon.vn/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/channel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/channel/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "K\u00eanh \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/urls?limit=2&page=1&order=date
Để lấy danh sách liên kết của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
order | (tùy chọn) Sắp xếp dữ liệu theo ngày hoặc số lần nhấp |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/urls?limit=2&page=1&order=date",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/urls?limit=2&page=1&order=date',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"urls": [
{
"id": 2,
"alias": "google",
"shorturl": "https:\/\/linkrutgon.vn\/google",
"longurl": "https:\/\/google.com",
"clicks": 0,
"title": "Google",
"description": "",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"alias": "googlecanada",
"shorturl": "https:\/\/linkrutgon.vn\/googlecanada",
"longurl": "https:\/\/google.ca",
"clicks": 0,
"title": "Google Canada",
"description": "",
"date": "2020-11-10 18:00:25"
}
]
}
}
https://linkrutgon.vn/api/url/:id
Để lấy chi tiết của một liên kết qua API, bạn có thể sử dụng endpoint này.
curl --location --request GET 'https://linkrutgon.vn/api/url/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/url/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/url/:id',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"details": {
"id": 1,
"shorturl": "https:\/\/linkrutgon.vn\/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://linkrutgon.vn/api/url/add
Để rút gọn một liên kết, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu POST. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
url | (bắt buộc) URL dài cần rút gọn. |
custom | (tùy chọn) Alias tùy chỉnh thay vì alias ngẫu nhiên. |
type | (tùy chọn) Loại chuyển hướng [direct, frame, splash], chỉ định id cho trang splash tùy chỉnh hoặc overlay-id cho trang CTA |
password | (tùy chọn) Bảo vệ bằng mật khẩu |
domain | (tùy chọn) Tên miền tùy chỉnh |
expiry | (tùy chọn) Thời gian hết hạn cho liên kết ví dụ 2021-09-28 23:11:16 |
geotarget | (tùy chọn) Dữ liệu định hướng địa lý |
devicetarget | (tùy chọn) Dữ liệu định hướng thiết bị |
languagetarget | (tùy chọn) Dữ liệu định hướng ngôn ngữ |
metatitle | (tùy chọn) Tiêu đề Meta |
metadescription | (tùy chọn) Mô tả Meta |
metaimage | (tùy chọn) Link đến hình ảnh jpg hoặc png |
curl --location --request POST 'https://linkrutgon.vn/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://linkrutgon.vn/api/url/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"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"
}
]
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/url/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"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"
}
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"shorturl": "https:\/\/linkrutgon.vn\/google"
}
https://linkrutgon.vn/api/url/:id/update
Để cập nhật một liên kết, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
url | (bắt buộc) URL dài cần rút gọn. |
custom | (tùy chọn) Alias tùy chỉnh thay vì alias ngẫu nhiên. |
type | (tùy chọn) Loại chuyển hướng [direct, frame, splash] |
password | (tùy chọn) Bảo vệ bằng mật khẩu |
domain | (tùy chọn) Tên miền tùy chỉnh |
expiry | (tùy chọn) Thời gian hết hạn cho liên kết, ví dụ 2021-09-28 23:11:16 |
geotarget | (tùy chọn) Dữ liệu định hướng địa lý |
devicetarget | (tùy chọn) Dữ liệu định hướng thiết bị |
languagetarget | (tùy chọn) Dữ liệu định hướng ngôn ngữ |
metatitle | (tùy chọn) Tiêu đề Meta |
metadescription | (tùy chọn) Mô tả Meta |
metaimage | (tùy chọn) Link đến hình ảnh jpg hoặc png |
curl --location --request PUT 'https://linkrutgon.vn/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://linkrutgon.vn/api/url/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"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"
}
]
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/url/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"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"
}
]
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"short": "https:\/\/linkrutgon.vn\/google"
}
https://linkrutgon.vn/api/url/:id/delete
Để xóa một liên kết, bạn cần gửi một yêu cầu DELETE.
curl --location --request DELETE 'https://linkrutgon.vn/api/url/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/url/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/url/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Li\u00ean k\u1ebft \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng"
}
https://linkrutgon.vn/api/overlay?limit=2&page=1
Để lấy danh sách lớp phủ CTA qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/overlay?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/overlay?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"cta": [
{
"id": 1,
"type": "tin nh\u1eafn",
"name": "Khuy\u1ebfn m\u00e3i S\u1ea3n ph\u1ea9m 1",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "li\u00ean h\u1ec7",
"name": "Trang Li\u00ean h\u1ec7",
"date": "2020-11-10 18:10:00"
}
]
}
}
https://linkrutgon.vn/api/splash?limit=2&page=1
Để lấy danh sách các trang màn hình tùy chỉnh qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết)
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/splash?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/splash?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"splash": [
{
"id": 1,
"name": "Khuy\u1ebfn m\u00e3i S\u1ea3n ph\u1ea9m 1",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"name": "Khuy\u1ebfn m\u00e3i S\u1ea3n ph\u1ea9m 2",
"date": "2020-11-10 18:10:00"
}
]
}
}
https://linkrutgon.vn/api/qr?limit=2&page=1
Để lấy danh sách mã QR của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/qr?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/qr?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"qrs": [
{
"id": 2,
"link": "https:\/\/linkrutgon.vn\/qr\/a2d5e",
"scans": 0,
"name": "Google",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"link": "https:\/\/linkrutgon.vn\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
}
]
}
}
https://linkrutgon.vn/api/qr/:id
Để lấy chi tiết của một mã QR qua API, bạn có thể sử dụng endpoint này.
curl --location --request GET 'https://linkrutgon.vn/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/qr/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/qr/:id',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"details": {
"id": 1,
"link": "https:\/\/linkrutgon.vn\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
},
"data": {
"clicks": 1,
"uniqueClicks": 1,
"topCountries": {
"Kh\u00f4ng x\u00e1c \u0111\u1ecbnh": "1"
},
"topReferrers": {
"Tr\u1ef1c ti\u1ebfp, email v\u00e0 c\u00e1c ngu\u1ed3n kh\u00e1c": "1"
},
"topBrowsers": {
"Chrome": "1"
},
"topOs": {
"Windows 10": "1"
},
"socialCount": {
"facebook": 0,
"twitter": 0,
"instagram": 0
}
}
}
https://linkrutgon.vn/api/qr/add
Để tạo một mã QR, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu POST. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
type | (bắt buộc) text | vcard | link | email | phone | sms | wifi |
data | (bắt buộc) Dữ liệu sẽ được nhúng vào mã QR. Dữ liệu có thể là chuỗi hoặc mảng tùy thuộc vào loại |
background | (tùy chọn) Màu nền RGB, ví dụ rgb(255,255,255) |
foreground | (tùy chọn) Màu chữ RGB, ví dụ rgb(0,0,0) |
logo | (tùy chọn) Đường dẫn tới logo dưới định dạng png hoặc jpg |
curl --location --request POST 'https://linkrutgon.vn/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://linkrutgon.vn/api/qr/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"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;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/qr/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 3,
"link": "https:\/\/linkrutgon.vn\/qr\/a58f79"
}
https://linkrutgon.vn/api/qr/:id/update
Để cập nhật một mã QR, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
data | (bắt buộc) Dữ liệu sẽ được nhúng vào mã QR. Dữ liệu có thể là chuỗi hoặc mảng tùy thuộc vào loại |
background | (tùy chọn) Màu nền RGB, ví dụ rgb(255,255,255) |
foreground | (tùy chọn) Màu chữ RGB, ví dụ rgb(0,0,0) |
logo | (tùy chọn) Đường dẫn tới logo dưới định dạng png hoặc jpg |
curl --location --request PUT 'https://linkrutgon.vn/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://linkrutgon.vn/api/qr/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"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;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/qr/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https:\/\/google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "M\u00e3 QR \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/qr/:id/delete
Để xóa một mã QR, bạn cần gửi một yêu cầu DELETE.
curl --location --request DELETE 'https://linkrutgon.vn/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/qr/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/qr/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "M\u00e3 QR \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/pixels?limit=2&page=1
Để lấy danh sách mã pixel của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/pixels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/pixels?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"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://linkrutgon.vn/api/pixel/add
Một pixel có thể được tạo bằng endpoint này. Bạn cần gửi loại pixel và mã tag.
Tham số | Mô tả |
---|---|
type | (bắt buộc) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok |
name | (bắt buộc) Tên tùy chỉnh cho pixel của bạn |
tag | (bắt buộc) Mã tag của pixel |
curl --location --request POST 'https://linkrutgon.vn/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "gtmpixel",
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/pixel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"type": "gtmpixel",
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/pixel/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "gtmpixel",
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1
}
https://linkrutgon.vn/api/pixel/:id/update
Để cập nhật một pixel, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
name | (tùy chọn) Tên tùy chỉnh cho pixel của bạn |
tag | (bắt buộc) Mã tag của pixel |
curl --location --request PUT 'https://linkrutgon.vn/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/pixel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/pixel/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "GTM c\u1ee7a t\u00f4i",
"tag": "GTM-ABCDE"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Pixel \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/pixel/:id/delete
Để xóa một pixel, bạn cần gửi một yêu cầu DELETE.
curl --location --request DELETE 'https://linkrutgon.vn/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/pixel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/pixel/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "Pixel \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/account
Để lấy thông tin tài khoản, bạn có thể gửi yêu cầu đến endpoint này và nó sẽ trả về dữ liệu liên quan đến tài khoản.
curl --location --request GET 'https://linkrutgon.vn/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/account',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"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://linkrutgon.vn/api/account/update
Để cập nhật thông tin tài khoản, bạn có thể gửi yêu cầu đến endpoint này và nó sẽ cập nhật dữ liệu liên quan đến tài khoản.
curl --location --request PUT 'https://linkrutgon.vn/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://linkrutgon.vn/api/account/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"email": "[email protected]",
"password": "newpassword"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/account/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"email": "[email protected]",
"password": "newpassword"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "T\u00e0i kho\u1ea3n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/domains?limit=2&page=1
Để lấy danh sách tên miền thương hiệu của bạn qua API, bạn có thể sử dụng endpoint này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
limit | (tùy chọn) Số lượng kết quả trên mỗi trang |
page | (tùy chọn) Yêu cầu trang hiện tại |
curl --location --request GET 'https://linkrutgon.vn/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://linkrutgon.vn/api/domains?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://linkrutgon.vn/api/domains?limit=2&page=1',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"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://linkrutgon.vn/api/domain/add
Bạn có thể thêm một tên miền bằng cách sử dụng endpoint này. Vui lòng đảm bảo tên miền được trỏ đúng đến máy chủ của chúng tôi.
Tham số | Mô tả |
---|---|
domain | (bắt buộc) Tên miền thương hiệu bao gồm http hoặc https |
redirectroot | (tùy chọn) Chuyển hướng gốc khi ai đó truy cập tên miền của bạn |
redirect404 | (tùy chọn) Chuyển hướng lỗi 404 tùy chỉnh |
curl --location --request POST 'https://linkrutgon.vn/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://linkrutgon.vn/api/domain/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://linkrutgon.vn/api/domain/add',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"id": 1
}
https://linkrutgon.vn/api/domain/:id/update
Để cập nhật một tên miền thương hiệu, bạn cần gửi dữ liệu hợp lệ dưới dạng JSON thông qua yêu cầu PUT. Dữ liệu phải được gửi dưới dạng nội dung thô của yêu cầu như minh họa bên dưới. Ví dụ bên dưới hiển thị tất cả các tham số bạn có thể gửi, nhưng không bắt buộc phải gửi tất cả (Xem bảng để biết thêm chi tiết).
Tham số | Mô tả |
---|---|
redirectroot | (tùy chọn) Chuyển hướng gốc khi ai đó truy cập tên miền của bạn |
redirect404 | (tùy chọn) Chuyển hướng lỗi 404 tùy chỉnh |
curl --location --request PUT 'https://linkrutgon.vn/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://linkrutgon.vn/api/domain/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS =>
'{
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://linkrutgon.vn/api/domain/:id/update',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "T\u00ean mi\u1ec1n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u00e0nh c\u00f4ng."
}
https://linkrutgon.vn/api/domain/:id/delete
Để xóa một tên miền, bạn cần gửi một yêu cầu DELETE.
curl --location --request DELETE 'https://linkrutgon.vn/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://linkrutgon.vn/api/domain/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://linkrutgon.vn/api/domain/:id/delete',
'headers': {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
{
"error": 0,
"message": "T\u00ean mi\u1ec1n \u0111\u00e3 \u0111\u01b0\u1ee3c x\u00f3a th\u00e0nh c\u00f4ng."
}