Uma chave de API é necessária para que as solicitações sejam processadas pelo sistema. Depois que um usuário se registra, uma chave de API é gerada automaticamente para esse usuário. A chave de API deve ser enviada com cada solicitação (veja o exemplo completo abaixo). Se a chave de API não for enviada ou tiver expirado, ocorrerá um erro. Certifique-se de manter sua chave de API em segredo para evitar abusos.
Para autenticar com o sistema de API, você precisa enviar sua chave de API como um token de autorização com cada solicitação. Você pode ver o código de exemplo abaixo.
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/account' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/account",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/account',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
cơ thể: ''
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/account"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/account");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
Nossa API tem um limitador de taxa para proteger contra picos de solicitações para maximizar sua estabilidade. Nosso limitador de taxa está limitado a 30 solicitações por 1 minuto. Xin lưu ý rằng tỷ giá có thể thay đổi tùy theo gói đã đăng ký.
Vários cabeçalhos serão enviados juntamente com a resposta e estes podem ser examinados para determinar várias informações sobre a solicitação.
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: TIMESTAMP
Todas as respostas da API são retornadas no formato JSON por padrão. Para converter isso em dados utilizáveis, a função apropriada precisará ser usada de acordo com o idioma. Em PHP, a função json_decode() pode ser usada para converter os dados em um objeto (padrão) ou um array (defina o segundo parâmetro como true). É muito importante verificar a chave de erro, pois ela fornece informações sobre se houve ou não um erro. Você também pode verificar o código do cabeçalho.
{
"error": 1,
"message": "An error occurred"
}
https://urlkai.com/api/account
Để lấy thông tin về tài khoản, bạn có thể gửi yêu cầu đến điểm cuối này và nó sẽ trả về dữ liệu trên tài khoản.
curl --location --request GET 'https://urlkai.com/api/account' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/account",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/account',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/account"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/account");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"dữ liệu": {
"id": 1,
"email": " [email được bảo vệ] ",
"tên người dùng": "người dùng mẫu",
"hình đại diện": "https:\/\/domain.com\/content\/avatar.png",
"status": "chuyên nghiệp",
"hết hạn": "2022-11-15 15:00:00",
"đã đăng ký": "2020-11-10 18:01:43"
}
}
https://urlkai.com/api/account/update
Để cập nhật thông tin về tài khoản, bạn có thể gửi yêu cầu đến điểm cuối này và nó sẽ cập nhật dữ liệu trên tài khoản.
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/account/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"email": " [email được bảo vệ] ",
"password": "mật khẩu mới"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/account/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"email": " [email được bảo vệ] ",
"password": "mật khẩu mới"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/account/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"email": " [email được bảo vệ] ",
"password": "mật khẩu mới"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/account/update"
tải trọng = {
"email": " [email được bảo vệ] ",
"password": "mật khẩu mới"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/account/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"email": " [email được bảo vệ] ",
"password": "mật khẩu mới"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Tài khoản đã được cập nhật thành công."
}
https://urlkai.com/api/campaigns?limit=2&page=1
Để tải chiến dịch của bạn qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/campaigns?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/campaigns?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/campaigns?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/campaigns?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/campaigns?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"chiến dịch": [
{
"id": 1,
"name": "Chiến dịch mẫu",
"public": sai,
"rotator": sai,
"danh sách": "https:\/\/domain.com\/u\/admin\/list-1"
},
{
"id": 2,
"domain": "Chiến dịch Facebook",
"public": đúng,
"rotator": "https:\/\/domain.com\/r\/test",
"danh sách": "https:\/\/domain.com\/u\/admin\/test-2"
}
]
}
}
https://urlkai.com/api/campaign/add
Bạn có thể thêm chiến dịch bằng điểm cuối này.
Parâmetro | Descrição |
---|---|
Tên | (tùy chọn) Tên chiến dịch |
sên | (tùy chọn) Sên xoay |
công cộng | (tùy chọn) Truy cập |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/campaign/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"name": "Chiến dịch mới",
"slug": "chiến dịch mới",
"public": đúng
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/campaign/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Chiến dịch mới",
"slug": "chiến dịch mới",
"public": đúng
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/campaign/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"name": "Chiến dịch mới",
"slug": "chiến dịch mới",
"public": đúng
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/campaign/add"
tải trọng = {
"name": "Chiến dịch mới",
"slug": "chiến dịch mới",
"public": đúng
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/campaign/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"name": "Chiến dịch mới",
"slug": "chiến dịch mới",
"public": đúng
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"domain": "Chiến dịch mới",
"public": đúng,
"rotator": "https:\/\/domain.com\/r\/chiến dịch mới",
"danh sách": "https:\/\/domain.com\/u\/admin\/new-campaign-3"
}
https://urlkai.com/api/campaign/:campaignid/assign/:linkid
Một liên kết ngắn có thể được gán cho một chiến dịch bằng cách sử dụng điểm cuối này. Điểm cuối yêu cầu ID chiến dịch và ID liên kết ngắn.
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/campaign/:campaignid/assign/:linkid' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/campaign/:campaignid/assign/:linkid",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/campaign/:campaignid/assign/:linkid',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/campaign/:campaignid/assign/:linkid"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/campaign/:campaignid/assign/:linkid");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Liên kết đã được thêm thành công vào chiến dịch."
}
https://urlkai.com/api/campaign/:id/update
Để cập nhật chiến dịch, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
Tên | (bắt buộc) Tên chiến dịch |
sên | (tùy chọn) Sên xoay |
công cộng | (tùy chọn) Truy cập |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/campaign/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"name": "Chiến dịch Twitter",
"slug": "chiến dịch twitter",
"public": đúng
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/campaign/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Chiến dịch Twitter",
"slug": "chiến dịch twitter",
"public": đúng
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/campaign/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"name": "Chiến dịch Twitter",
"slug": "chiến dịch twitter",
"public": đúng
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/campaign/:id/update"
tải trọng = {
"name": "Chiến dịch Twitter",
"slug": "chiến dịch twitter",
"public": đúng
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/campaign/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"name": "Chiến dịch Twitter",
"slug": "chiến dịch twitter",
"public": đúng
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"domain": "Chiến dịch Twitter",
"public": đúng,
"rotator": "https:\/\/domain.com\/r\/twitter-campaign",
"danh sách": "https:\/\/domain.com\/u\/admin\/twitter-campaign-3"
}
https://urlkai.com/api/campaign/:id/delete
Để xóa chiến dịch, bạn cần gửi yêu cầu XÓA.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/campaign/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/campaign/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/campaign/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/campaign/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/campaign/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Chiến dịch đã bị xóa thành công."
}
https://urlkai.com/api/channels?limit=2&page=1
Để tải kênh của bạn qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/channels?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/channels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/channels?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channels?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var request = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/channels?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"kênh": [
{
"id": 1,
"tên": "Kênh 1",
"description": "Mô tả kênh 1",
"màu": "#000000",
"Gắn sao": đúng
},
{
"id": 2,
"tên": "Kênh 2",
"description": "Mô tả kênh 2",
"màu": "#FF0000",
"gắn sao": sai
}
]
}
}
https://urlkai.com/api/channel/:id?limit=1&page=1
Để lấy các mục trong một kênh được chọn thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/channel/:id?limit=1&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/channel/:id?limit=1&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/channel/:id?limit=1&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channel/:id?limit=1&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/channel/:id?limit=1&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"mục": [
{
"type": "liên kết",
"id": 1,
"title": "Liên kết mẫu của tôi",
"preview": "https:\/\/google.com",
"liên kết": "https:\/\/urlkai.com\/google",
"ngày": "2022-05-12"
},
{
"type": "tiểu sử",
"id": 1,
"title": "Tiểu sử mẫu của tôi",
"preview": "https:\/\/urlkai.com\/mybio",
"liên kết": "https:\/\/urlkai.com\/mybio",
"ngày": "2022-06-01"
}
]
}
}
https://urlkai.com/api/channel/add
Một kênh có thể được thêm vào bằng cách sử dụng điểm cuối này.
Parâmetro | Descrição |
---|---|
Tên | (bắt buộc) Tên kênh |
sự miêu tả | (tùy chọn) Mô tả kênh |
màu | (tùy chọn) Màu huy hiệu kênh (HEX) |
Đóng | (tùy chọn) Gắn dấu sao cho kênh hay không (đúng hoặc sai) |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/channel/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/channel/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/channel/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channel/add"
tải trọng = {
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/channel/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"name": "Kênh mới",
"description": "kênh mới của tôi",
"màu": "#000000",
"Gắn sao": đúng
}
https://urlkai.com/api/channel/:channelid/assign/:type/:itemid
Một mục có thể được gán cho bất kỳ kênh nào bằng cách gửi yêu cầu với id kênh, loại mục (liên kết, tiểu sử hoặc qr) và id mục.
Parâmetro | Descrição |
---|---|
:kênhid | (bắt buộc) ID kênh |
:kiểu | (bắt buộc) liên kết hoặc tiểu sử hoặc QR |
:itemid | (bắt buộc) ID mặt hàng |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/channel/:channelid/assign/:type/:itemid' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/channel/:channelid/assign/:type/:itemid",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/channel/:channelid/assign/:type/:itemid',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channel/:channelid/assign/:type/:itemid"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/channel/:channelid/assign/:type/:itemid");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Mục đã được thêm thành công vào kênh."
}
https://urlkai.com/api/channel/:id/update
Để cập nhật kênh, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
Tên | (tùy chọn) Tên kênh |
sự miêu tả | (tùy chọn) Mô tả kênh |
màu | (tùy chọn) Màu huy hiệu kênh (HEX) |
Đóng | (tùy chọn) Gắn dấu sao cho kênh hay không (đúng hoặc sai) |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/channel/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"name": "Tập đoàn Acme",
"description": "kênh cho các mặt hàng cho Acme Corp",
"màu": "#FFFFFF",
"gắn sao": sai
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/channel/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "Tập đoàn Acme",
"description": "kênh cho các mặt hàng cho Acme Corp",
"màu": "#FFFFFF",
"gắn sao": sai
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/channel/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"name": "Tập đoàn Acme",
"description": "kênh cho các mặt hàng cho Acme Corp",
"màu": "#FFFFFF",
"gắn sao": sai
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channel/:id/update"
tải trọng = {
"name": "Tập đoàn Acme",
"description": "kênh cho các mặt hàng cho Acme Corp",
"màu": "#FFFFFF",
"gắn sao": sai
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/channel/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"name": "Tập đoàn Acme",
"description": "kênh cho các mặt hàng cho Acme Corp",
"màu": "#FFFFFF",
"gắn sao": sai
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Kênh đã được cập nhật thành công."
}
https://urlkai.com/api/channel/:id/delete
Để xóa kênh, bạn cần gửi yêu cầu XÓA. Tất cả các vật phẩm cũng sẽ không được chỉ định.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/channel/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/channel/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/channel/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/channel/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/channel/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Kênh đã bị xóa thành công."
}
https://urlkai.com/api/qr?limit=2&page=1
Để nhận mã QR của bạn qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/qr?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/qr?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/qr?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/qr?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/qr?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"qrs": [
{
"id": 2,
"liên kết": "https:\/\/urlkai.com\/QR\/A2D5E",
"quét": 0,
"name": "Google",
"Date": "2020-11-10 18:01:43"
},
{
"id": 1,
"liên kết": "https:\/\/urlkai.com\/qr\/b9edfe",
"quét": 5,
"name": "Google Canada",
"Date": "2020-11-10 18:00:25"
}
]
}
}
https://urlkai.com/api/qr/:id
Để nhận thông tin chi tiết cho một mã QR thông qua API, bạn có thể sử dụng điểm cuối này.
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/qr/:id' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/qr/:id",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/qr/:id',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/qr/:id"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var request = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/qr/:id");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"chi tiết": {
"id": 1,
"liên kết": "https:\/\/urlkai.com\/qr\/b9edfe",
"quét": 5,
"name": "Google Canada",
"Date": "2020-11-10 18:00:25"
},
"dữ liệu": {
"nhấp chuột": 1,
"uniqueClicks": 1,
"topCountries": {
"Không xác định": "1"
},
"topReferrers": {
"Trực tiếp, email và khác": "1"
},
"trình duyệt hàng đầu": {
"Chrome": "1"
},
"topOs": {
"Windows 10": "1"
},
"đếm xã hội": {
"facebook": 0,
"twitter": 0,
"Instagram": 0
}
}
}
https://urlkai.com/api/qr/add
Để tạo Mã QR, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
kiểu | (bắt buộc) văn bản | Thẻ vCard | liên kết | Thư điện tử | Điện thoại | SMS | Wifi |
dữ liệu | (bắt buộc) Dữ liệu được nhúng bên trong mã QR. Dữ liệu có thể là chuỗi hoặc mảng tùy thuộc vào loại |
nền | (tùy chọn) Màu RGB, ví dụ: rgb(255,255,255) |
Foreground | (tùy chọn) Màu RGB, ví dụ: rgb(0,0,0) |
logo | (tùy chọn) Đường dẫn đến logo png hoặc jpg |
Tên | (tùy chọn) Tên mã QR |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/qr/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png",
"name": "API mã QR"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/qr/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png",
"name": "API mã QR"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/qr/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png",
"name": "API mã QR"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/qr/add"
tải trọng = {
"type": "liên kết",
"data": "https://google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "API mã QR"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/qr/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png",
"name": "API mã QR"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"liên kết": "https:\/\/urlkai.com\/QR\/A58F79"
}
https://urlkai.com/api/qr/:id/update
Để cập nhật Mã QR, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
dữ liệu | (bắt buộc) Dữ liệu được nhúng bên trong mã QR. Dữ liệu có thể là chuỗi hoặc mảng tùy thuộc vào loại |
nền | (tùy chọn) Màu RGB, ví dụ: rgb(255,255,255) |
Foreground | (tùy chọn) Màu RGB, ví dụ: rgb(0,0,0) |
logo | (tùy chọn) Đường dẫn đến logo png hoặc jpg |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/qr/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/qr/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/qr/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/qr/:id/update"
tải trọng = {
"type": "liên kết",
"data": "https://google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/qr/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"type": "liên kết",
"dữ liệu": "https:\/\/google.com",
"nền": "rgb(255,255,255)",
"tiền cảnh": "rgb(0,0,0)",
"logo": "https:\/\/site.com\/logo.png"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "QR đã được cập nhật thành công."
}
https://urlkai.com/api/qr/:id/delete
Để xóa mã QR, bạn cần gửi yêu cầu XÓA.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/qr/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/qr/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/qr/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/qr/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/qr/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Mã QR đã được xóa thành công."
}
https://urlkai.com/api/domains?limit=2&page=1
Để nhận miền có thương hiệu của bạn thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/domains?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/domains?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/domains?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/domains?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/domains?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"miền": [
{
"id": 1,
"miền": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
},
{
"id": 2,
"miền": "https:\/\/domain2.com",
"redirectroot": "https:\/\/rootdomain2.com",
"redirect404": "https:\/\/rootdomain2.com\/404"
}
]
}
}
https://urlkai.com/api/domain/add
Một miền có thể được thêm vào bằng cách sử dụng điểm cuối này. Vui lòng đảm bảo tên miền được trỏ chính xác đến máy chủ của chúng tôi.
Parâmetro | Descrição |
---|---|
miền | (bắt buộc) Tên miền có thương hiệu bao gồm http hoặc https |
chuyển hướngroot | (tùy chọn) Chuyển hướng gốc khi ai đó truy cập miền của bạn |
chuyển hướng404 | (tùy chọn) Chuyển hướng 404 tùy chỉnh |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/domain/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"miền": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/domain/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"miền": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/domain/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"miền": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/domain/add"
tải trọng = {
"miền": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/domain/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"miền": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 1
}
https://urlkai.com/api/domain/:id/update
Để cập nhật tên miền có thương hiệu, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
chuyển hướngroot | (tùy chọn) Chuyển hướng gốc khi ai đó truy cập miền của bạn |
chuyển hướng404 | (tùy chọn) Chuyển hướng 404 tùy chỉnh |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/domain/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/domain/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/domain/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/domain/:id/update"
tải trọng = {
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/domain/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"redirectroot": "https:\/\/rootdomain-new.com",
"redirect404": "https:\/\/rootdomain-new.com\/404"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Tên miền đã được cập nhật thành công."
}
https://urlkai.com/api/domain/:id/delete
Để xóa miền, bạn cần gửi yêu cầu DELETE.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/domain/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/domain/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/domain/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/domain/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/domain/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Tên miền đã được xóa thành công."
}
https://urlkai.com/api/urls?limit=2&page=1o=date
Để lấy liên kết của bạn thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
trật tự | (tùy chọn) Sắp xếp dữ liệu giữa ngày hoặc nhấp chuột |
thấp | (tùy chọn) Tìm kiếm bằng url ngắn. Lưu ý rằng khi bạn sử dụng tham số short, tất cả các tham số khác sẽ bị bỏ qua và nếu có kết quả khớp, phản hồi Single Link sẽ được trả về. |
q | (tùy chọn) Tìm kiếm liên kết bằng từ khóa |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/urls?limit=2&page=1o=date' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/urls?limit=2&page=1o=date",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/urls?limit=2&page=1o=date',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/urls?limit=2&page=1o=date"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/urls?limit=2&page=1o=date");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"urls": [
{
"id": 2,
"bí danh": "google",
"shorturl": "https:\/\/urlkai.com\/google",
"longurl": "https:\/\/google.com",
"nhấp chuột": 0,
"title": "Google",
"mô tả": "",
"Date": "2020-11-10 18:01:43"
},
{
"id": 1,
"bí danh": "googlecanada",
"shorturl": "https:\/\/urlkai.com\/googlecanada",
"longurl": "https:\/\/google.ca",
"nhấp chuột": 0,
"title": "Google Canada",
"mô tả": "",
"Date": "2020-11-10 18:00:25"
}
]
}
}
https://urlkai.com/api/url/:id
Để nhận thông tin chi tiết cho một liên kết thông qua API, bạn có thể sử dụng điểm cuối này.
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/url/:id' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/url/:id",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/url/:id',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/url/:id"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var request = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/url/:id");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 1,
"chi tiết": {
"id": 1,
"shorturl": "https:\/\/urlkai.com\/googlecanada",
"longurl": "https:\/\/google.com",
"title": "Google",
"mô tả": "",
"vị trí": {
"Canada": "https:\/\/google.ca",
"Hoa Kỳ": "https:\/\/google.us"
},
"thiết bị": {
"iphone": "https:\/\/google.com",
"android": "https:\/\/google.com"
},
"hết hạn": null,
"Date": "2020-11-10 18:01:43"
},
"dữ liệu": {
"nhấp chuột": 0,
"uniqueClicks": 0,
"topCountries": 0,
"topGiới thiệu": 0,
"trình duyệt hàng đầu": 0,
"topOs": 0,
"đếm xã hội": {
"facebook": 0,
"twitter": 0,
"google": 0
}
}
}
https://urlkai.com/api/url/add
Để rút ngắn liên kết, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
Url | (bắt buộc) URL dài để rút ngắn. |
phong tục | (tùy chọn) Bí danh tùy chỉnh thay vì bí danh ngẫu nhiên. |
kiểu | (tùy chọn) Loại chuyển hướng [trực tiếp, khung, giật gân], chỉ Id cho trang giật gân tùy chỉnh hoặc lớp phủ id Đối với các trang CTA |
mật khẩu | (tùy chọn) Bảo vệ bằng mật khẩu |
miền | (tùy chọn) Tên miền tùy chỉnh |
Hết hạn | (tùy chọn) Hết hạn cho ví dụ liên kết 2021-09-28 23:11:16 |
mục tiêu địa lý | (tùy chọn) Dữ liệu nhắm mục tiêu theo địa lý |
mục tiêu thiết bị | (tùy chọn) Dữ liệu nhắm mục tiêu thiết bị |
Mục tiêu ngôn ngữ | (tùy chọn) Dữ liệu nhắm mục tiêu ngôn ngữ |
siêu tiêu đề | (tùy chọn) Tiêu đề meta |
Mô tả siêu | (tùy chọn) Mô tả meta |
siêu hình ảnh | (tùy chọn) Liên kết đến hình ảnh jpg hoặc png |
sự miêu tả | (tùy chọn) Ghi chú hoặc mô tả |
Pixel | (tùy chọn) Mảng id pixel |
kênh | (tùy chọn) ID kênh |
chiến dịch | (tùy chọn) ID chiến dịch |
liên kết sâu | (tùy chọn) Đối tượng chứa liên kết cửa hàng ứng dụng. Khi sử dụng tính năng này, điều quan trọng là phải đặt nhắm mục tiêu thiết bị. (Mới) Bây giờ bạn có thể đặt tham số "auto" thành true để tự động tạo các liên kết sâu từ liên kết dài được cung cấp. |
tình trạng | (tùy chọn) công cộng hoặc riêng tư (mặc định) |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/url/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"url": "https:\/\/google.com",
"status": "riêng tư",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"metatitle": "Không phải Google",
"metadescription": "Không phải mô tả của Google",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"description": "Đối với facebook",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"chiến dịch": 1,
"liên kết sâu": {
"auto": đúng,
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"languagetarget": [
{
"ngôn ngữ": "en",
"liên kết": "https:\/\/google.com"
},
{
"ngôn ngữ": "fr",
"liên kết": "https:\/\/google.ca"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/url/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"url": "https:\/\/google.com",
"status": "riêng tư",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"metatitle": "Không phải Google",
"metadescription": "Không phải mô tả của Google",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"description": "Đối với facebook",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"chiến dịch": 1,
"liên kết sâu": {
"auto": đúng,
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"languagetarget": [
{
"ngôn ngữ": "en",
"liên kết": "https:\/\/google.com"
},
{
"ngôn ngữ": "fr",
"liên kết": "https:\/\/google.ca"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/url/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"url": "https:\/\/google.com",
"status": "riêng tư",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"metatitle": "Không phải Google",
"metadescription": "Không phải mô tả của Google",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"description": "Đối với facebook",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"chiến dịch": 1,
"liên kết sâu": {
"auto": đúng,
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"languagetarget": [
{
"ngôn ngữ": "en",
"liên kết": "https:\/\/google.com"
},
{
"ngôn ngữ": "fr",
"liên kết": "https:\/\/google.ca"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/url/add"
tải trọng = {
"url": "https://google.com",
"status": "riêng tư",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"metatitle": "Không phải Google",
"metadescription": "Không phải mô tả của Google",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "Đối với facebook",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"chiến dịch": 1,
"liên kết sâu": {
"auto": đúng,
"táo": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=Hoa Kỳ"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "Hoa Kỳ",
"link": "https://google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"ngôn ngữ": "en",
"link": "https://google.com"
},
{
"ngôn ngữ": "fr",
"link": "https://google.ca"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/url/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"url": "https:\/\/google.com",
"status": "riêng tư",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"metatitle": "Không phải Google",
"metadescription": "Không phải mô tả của Google",
"metaimage": "https:\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png",
"description": "Đối với facebook",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"chiến dịch": 1,
"liên kết sâu": {
"auto": đúng,
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"languagetarget": [
{
"ngôn ngữ": "en",
"liên kết": "https:\/\/google.com"
},
{
"ngôn ngữ": "fr",
"liên kết": "https:\/\/google.ca"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"shorturl": "https:\/\/urlkai.com\/google"
}
https://urlkai.com/api/url/:id/update
Để cập nhật liên kết, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
Url | (bắt buộc) URL dài để rút ngắn. |
phong tục | (tùy chọn) Bí danh tùy chỉnh thay vì bí danh ngẫu nhiên. |
kiểu | (tùy chọn) Loại chuyển hướng [trực tiếp, khung, giật gân] |
mật khẩu | (tùy chọn) Bảo vệ bằng mật khẩu |
miền | (tùy chọn) Tên miền tùy chỉnh |
Hết hạn | (tùy chọn) Hết hạn cho ví dụ liên kết 2021-09-28 23:11:16 |
mục tiêu địa lý | (tùy chọn) Dữ liệu nhắm mục tiêu theo địa lý |
mục tiêu thiết bị | (tùy chọn) Dữ liệu nhắm mục tiêu thiết bị |
Mục tiêu ngôn ngữ | (tùy chọn) Dữ liệu nhắm mục tiêu ngôn ngữ |
siêu tiêu đề | (tùy chọn) Tiêu đề meta |
Mô tả siêu | (tùy chọn) Mô tả meta |
siêu hình ảnh | (tùy chọn) Liên kết đến hình ảnh jpg hoặc png |
Pixel | (tùy chọn) Mảng id pixel |
kênh | (tùy chọn) ID kênh |
chiến dịch | (tùy chọn) ID chiến dịch |
liên kết sâu | (tùy chọn) Đối tượng chứa liên kết cửa hàng ứng dụng. Khi sử dụng tính năng này, điều quan trọng là phải đặt nhắm mục tiêu thiết bị. |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/url/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"liên kết sâu": {
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/url/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"liên kết sâu": {
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/url/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"liên kết sâu": {
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/url/:id/update"
tải trọng = {
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"liên kết sâu": {
"táo": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=Hoa Kỳ"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "Hoa Kỳ",
"link": "https://google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/url/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"url": "https:\/\/google.com",
"custom": "google",
"password": "mypass",
"hết hạn": "2020-11-11 12:00:00",
"type": "giật gân",
"pixel": [
1,
2,
3,
4
],
"kênh": 1,
"liên kết sâu": {
"táo": "https:\/\/apps.apple.com\/us\/app\/google\/id284815942",
"google": "https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=US"
},
"mục tiêu địa lý": [
{
"location": "Canada",
"liên kết": "https:\/\/google.ca"
},
{
"location": "Hoa Kỳ",
"liên kết": "https:\/\/google.us"
}
],
"devicetarget": [
{
"thiết bị": "iPhone",
"liên kết": "https:\/\/google.com"
},
{
"device": "Android",
"liên kết": "https:\/\/google.com"
}
],
"tham số": [
{
"tên": "aff",
"giá trị": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 3,
"short": "https:\/\/urlkai.com\/google"
}
https://urlkai.com/api/url/:id/delete
Để xóa liên kết, bạn cần gửi yêu cầu XÓA.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/url/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/url/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/url/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/url/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/url/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Liên kết đã bị xóa thành công"
}
https://urlkai.com/api/pixels?limit=2&page=1
Để lấy mã pixel của bạn thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/pixels?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/pixels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/pixels?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/pixels?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var request = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/pixels?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"pixel": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"thẻ": "GA-123456789",
"Date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "twitterpixel",
"name": "Twitter Pixel",
"thẻ": "1234567",
"ngày": "2020-11-10 18:10:00"
}
]
}
}
https://urlkai.com/api/pixel/add
Một pixel có thể được tạo bằng điểm cuối này. Bạn cần gửi loại pixel và thẻ.
Parâmetro | Descrição |
---|---|
kiểu | (bắt buộc) gtmpixel | Gapixel | FBPIXEL | AdwordsPixel | Linkedinpixel | Twitterpixel | Adrollpixel | Quorapixel | Pinterest | Bing | Snapchat | Reddit | Tiktok |
Tên | (bắt buộc) Tên tùy chỉnh cho pixel |
thẻ | (bắt buộc) Thẻ cho pixel |
curl --vị trí --yêu cầu POST 'https://urlkai.com/api/pixel/add' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"type": "gtmpixel",
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/pixel/add",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐĂNG",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"type": "gtmpixel",
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'ĐĂNG',
'url': 'https://urlkai.com/api/pixel/add',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"type": "gtmpixel",
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/pixel/add"
tải trọng = {
"type": "gtmpixel",
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/pixel/add");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"type": "gtmpixel",
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"id": 1
}
https://urlkai.com/api/pixel/:id/update
Để cập nhật pixel, bạn cần gửi dữ liệu hợp lệ ở 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 của bạn như hình dưới đây. Ví dụ dưới đây cho thấy tất cả các thông số bạn có thể gửi nhưng bạn không bắt buộc phải gửi tất cả (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
Tên | (tùy chọn) Tên tùy chỉnh cho pixel |
thẻ | (bắt buộc) Thẻ cho pixel |
curl --vị trí --yêu cầu PUT 'https://urlkai.com/api/pixel/:id/update' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
--data-raw '{
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/pixel/:id/update",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "ĐẶT",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
CURLOPT_POSTFIELDS =>
'{
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'PUT',
'url': 'https://urlkai.com/api/pixel/:id/update',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
nội dung: JSON.stringify({
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}),
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/pixel/:id/update"
tải trọng = {
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("PUT", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Put, "https://urlkai.com/api/pixel/:id/update");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{
"name": "GTM của tôi",
"tag": "GTM-ABCDE"
}", System.Text.Encoding.UTF8, "ứng dụng/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Pixel đã được cập nhật thành công."
}
https://urlkai.com/api/pixel/:id/delete
Để xóa pixel, bạn cần gửi yêu cầu XÓA.
curl --vị trí --yêu cầu XÓA 'https://urlkai.com/api/pixel/:id/delete' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/pixel/:id/delete",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "XÓA",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'method': 'XÓA',
'url': 'https://urlkai.com/api/pixel/:id/delete',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/pixel/:id/delete"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("DELETE", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Delete, "https://urlkai.com/api/pixel/:id/delete");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": 0,
"message": "Pixel đã bị xóa thành công."
}
https://urlkai.com/api/overlay?limit=2&page=1
Để nhận lớp phủ cta thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/overlay?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL => "https://urlkai.com/api/overlay?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/overlay?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/overlay?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var yêu cầu = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/overlay?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"CTA": [
{
"id": 1,
"type": "tin nhắn",
"name": "Khuyến mãi sản phẩm 1",
"Date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "liên hệ",
"name": "Trang liên hệ",
"ngày": "2020-11-10 18:10:00"
}
]
}
}
https://urlkai.com/api/splash?limit=2&page=1
Để nhận các trang giật gân tùy chỉnh thông qua API, bạn có thể sử dụng điểm cuối này. Bạn cũng có thể lọc dữ liệu (Xem bảng để biết thêm thông tin).
Parâmetro | Descrição |
---|---|
giới hạn | (tùy chọn) Kết quả dữ liệu trên mỗi trang |
trang | (tùy chọn) Yêu cầu trang hiện tại |
curl --vị trí --yêu cầu GET 'https://urlkai.com/api/splash?limit=2&page=1' \
--header 'Ủy quyền: Người mang YOURAPIKEY' \
--header 'Loại nội dung: ứng dụng / json' \
$curl = curl_init();
curl_setopt_array($curl, mảng(
CURLOPT_URL = > "https://urlkai.com/api/splash?limit=2&page=1",
CURLOPT_RETURNTRANSFER => đúng,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => đúng,
CURLOPT_CUSTOMREQUEST => "NHẬN",
CURLOPT_HTTPHEADER => [
"Ủy quyền: Người mang YOURAPIKEY",
"Loại nội dung: ứng dụng / json",
],
));
$response = curl_exec ($curl);
curl_close ($curl);
tiếng vang $response;
var yêu cầu = require('yêu cầu');
var options = {
'phương thức': 'GET',
'url': 'https://urlkai.com/api/splash?limit=2&page=1',
'tiêu đề': {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
},
};
request(tùy chọn, hàm (lỗi, phản hồi) {
if (lỗi) throw new Error(lỗi);
console.log(phản hồi.cơ thể);
});
Yêu cầu nhập
url = "https://urlkai.com/api/splash?limit=2&page=1"
tải trọng = {}
tiêu đề = {
'Ủy quyền': 'Người mang YOURAPIKEY',
'Content-Type': 'ứng dụng/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
in (phản hồi.văn bản)
var client = HttpClient mới();
var request = mới HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/splash?limit=2&page=1");
yêu cầu. Headers.Add("Ủy quyền", "Người mang YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
yêu cầu. Nội dung = nội dung;
var response = chờ khách hàng. SendAsync(yêu cầu);
phản ứng. EnsureSuccessStatusCode();
Console.WriteLine(chờ phản hồi. Content.ReadAsStringAsync());
{
"lỗi": "0",
"dữ liệu": {
"kết quả": 2,
"perpage": 2,
"trang hiện tại": 1,
"trang tiếp theo": 1,
"maxpage": 1,
"splash": [
{
"id": 1,
"name": "Khuyến mãi sản phẩm 1",
"Date": "2020-11-10 18:00:00"
},
{
"id": 2,
"name": "Khuyến mãi sản phẩm 2",
"ngày": "2020-11-10 18:10:00"
}
]
}
}