# Developers
**Source:** https://zh-hant.urlkai.com/developers
**Language:** Traditional Chinese

---

開始 

認證 

速率限制 

回應處理 

###### 帳戶

獲取帳戶 

更新帳戶

###### 品牌功能變數名稱

列出品牌域 

創建品牌域 

更新域 

刪除域

###### 號召性用語疊加

列出 CTA 疊加

###### 活動

列出營銷活動 

創建營銷活動 

將連結分配給營銷活動 

更新活動 

刪除活動

###### 管道

列出頻道 

列出頻道項 

創建頻道 

將專案分配給管道 

更新頻道 

刪除頻道

###### 自定義Splash

列出自定義啟動畫面

###### 檔

列出檔 

上傳檔

###### 連結

列出連結 

獲取單個連結 

縮短連結 

更新連結 

刪除連結

###### 圖元

列出圖元 

創建 Pixel 像素代碼 

更新 Pixel 像素代碼 

刪除圖元

###### 二維碼

列出二維碼 

獲取單個 QR 碼 

創建 QR 碼 

更新二維碼 

刪除 QR 碼

#### 面向開發人員的 API 參考

###### 開始

系統處理的請求需要 API 金鑰。用戶註冊后，將為此用戶自動生成 API 金鑰。API 金鑰必須與每個請求一起發送（請參閱下面的完整範例）。如果 API 金鑰未發送或已過期，則會出現錯誤。請務必對您的 API 金鑰保密，以防止濫用。

###### 認證

要使用 API 系統進行身份驗證，您需要將 API 金鑰作為授權權杖與每個請求一起發送。您可以在下面看到範例代碼。

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/account' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;
curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/account”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
));

$response = curl_exec（$curl）;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/account'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    body： ''
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/account”
有效載荷 = {}
標頭 = {
  '授權'： 'Bearer YOURAPIKEY'，
  '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/account”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 速率限制

我們的 API 有一個速率限制器，可以防止請求激增，從而最大限度地提高其穩定性。我們的速率限制器目前的上限為每分鐘 30 個請求。請注意，費率可能會根據訂閱的計劃而變化。

多個標頭將與回應一起發送，可以檢查這些標頭以確定有關請求的各種資訊。

```
X-RateLimit-Limit: 30  
X-RateLimit-Remaining: 29  
X-RateLimit-Reset: TIMESTAMP
```

###### 回應處理

默認情況下，所有 API 回應都以 JSON 格式返回。要將其轉換為可用數據，需要根據語言使用適當的函數。在 PHP 中，函數 json\_decode（） 可用於將資料轉換為物件（預設）或數位（將第二個參數設置為 true）。檢查錯誤鍵非常重要，因為它提供了有關是否存在錯誤的資訊。您還可以檢查 header 代碼。

```
{
    "error": 1,
    "message": "An error occurred"
}
```

---

#### 帳戶 - Open in ChatGPT - Open in Claude

###### 獲取帳戶

獲取  `https://urlkai.com/api/account`

要獲取有關該帳戶的資訊，您可以向此終端節點發送請求，它將返回該賬戶的數據。

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/account' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/account”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/account'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/account”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/account”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “數據”： {
        “id”： 1，
        “電子郵件”： ” [電子郵件保護] ",
        “使用者名”： “sampleuser”，
        “頭像”： “https：\/\/domain.com\/content\/avatar.png”，
        “status”： “pro”， @狀態
        “expires”： “2022-11-15 15：00：00”， @過期
        “registered”： “2020-11-10 18：01：43”
    }
}
```

###### 更新帳戶

放  `https://urlkai.com/api/account/update`

要更新有關帳戶的資訊，您可以向此終端節點發送請求，它將更新有關該帳戶的數據。

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/account/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “電子郵件”： ” [電子郵件保護] ",
    “password”： “newpassword”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/account/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “電子郵件”： ” [電子郵件保護] ",
	    “password”： “newpassword”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/account/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “電子郵件”： ” [電子郵件保護] ",
    “password”： “newpassword”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/account/update”
有效載荷 = {
    “電子郵件”： ” [電子郵件保護] ",
    “password”： “newpassword”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/account/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “電子郵件”： ” [電子郵件保護] ",
    “password”： “newpassword”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “帳戶已成功更新。”
}
```

---

#### 品牌功能變數名稱 - Open in ChatGPT - Open in Claude

###### 列出品牌域

獲取  `https://urlkai.com/api/domains?limit=2&page=1`

要通過 API 獲取您的品牌域，您可以使用此終端節點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/domains?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/domains?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/domains?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/domains?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/domains?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “domains”： [
            {
                “id”： 1，
                “domain”： “https：\/\/domain1.com”， // （ 2000） 域
                “redirectroot”： “https：\/\/rootdomain.com”， /
                “redirect404”： “https：\/\/rootdomain.com\/404”
            },
            {
                “id”：2、
                “域”： “HTTPs：\/\/domain2.com”，
                “redirectroot”： “https：\/\/rootdomain2.com”， //
                “redirect404”： “https：\/\/rootdomain2.com\/404”
            }
        ]
    }
}
```

###### 創建品牌域

發佈  `https://urlkai.com/api/domain/add`

可以使用此終端節點添加域。請確保域正確指向我們的伺服器。

| **參數** | **描述** |
| --- | --- |
| 域 | （必填）品牌域，包括 HTTP 或 HTTPs |
| 重定向根 | （選擇）當有人訪問您的域時進行根重定向 |
| 重定向404 | （選擇）自定義 404 重定向 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/domain/add' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “domain”： “https：\/\/domain1.com”， // （ 2000） 域
    “redirectroot”： “https：\/\/rootdomain.com”， /
    “redirect404”： “https：\/\/rootdomain.com\/404”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/domain/add”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “domain”： “https：\/\/domain1.com”， // （ 2000） 域
	    “redirectroot”： “https：\/\/rootdomain.com”， /
	    “redirect404”： “https：\/\/rootdomain.com\/404”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/domain/add'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “domain”： “https：\/\/domain1.com”， // （ 2000） 域
    “redirectroot”： “https：\/\/rootdomain.com”， /
    “redirect404”： “https：\/\/rootdomain.com\/404”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/domain/add”
有效載荷 = {
    “domain”： “https://domain1.com”， @域“： ”“，
    “redirectroot”： “https://rootdomain.com”， //
    “redirect404”： “https://rootdomain.com/404”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/domain/add”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “domain”： “https：\/\/domain1.com”， // （ 2000） 域
    “redirectroot”： “https：\/\/rootdomain.com”， /
    “redirect404”： “https：\/\/rootdomain.com\/404”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”：1
}
```

###### 更新域

放  `https://urlkai.com/api/domain/:id/update`

要更新品牌域，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 重定向根 | （選擇）當有人訪問您的域時進行根重定向 |
| 重定向404 | （選擇）自定義 404 重定向 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/domain/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “redirectroot”： “https：\/\/rootdomain-new.com”， ///
    “redirect404”： “https：\/\/rootdomain-new.com\/404”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/domain/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “redirectroot”： “https：\/\/rootdomain-new.com”， ///
	    “redirect404”： “https：\/\/rootdomain-new.com\/404”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/domain/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：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）;
});
```

```
匯入請求
url = “https://urlkai.com/api/domain/:id/update”
有效載荷 = {
    “redirectroot”： “https://rootdomain-new.com”， //
    “redirect404”： “https://rootdomain-new.com/404”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/domain/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “redirectroot”： “https：\/\/rootdomain-new.com”， ///
    “redirect404”： “https：\/\/rootdomain-new.com\/404”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “域已成功更新。”
}
```

###### 刪除域

刪除  `https://urlkai.com/api/domain/:id/delete`

要刪除域，您需要發送 DELETE 請求。

cURL
PHP
Node.js
Python
C#

```
curl --location --request 刪除 'https://urlkai.com/api/domain/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/domain/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/domain/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/domain/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/domain/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功刪除域。”
}
```

---

#### 號召性用語疊加 - Open in ChatGPT - Open in Claude

###### 列出 CTA 疊加

獲取  `https://urlkai.com/api/overlay?limit=2&page=1`

要通過 API 獲取 CTA 疊加，您可以使用此端點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/overlay?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/overlay?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/overlay?limit=2&page=1' ，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/overlay?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/overlay?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “CTA”：[
            {
                “id”： 1，
                “type”： “消息”，
                “name”： “產品 1 促銷”，
                “date”： “2020-11-10 18：00：00”
            },
            {
                “id”：2、
                “type”： “聯繫人”，
                “name”： “聯繫頁面”，
                “date”： “2020-11-10 18：10：00”
            }
        ]
    }
}
```

---

#### 活動 - Open in ChatGPT - Open in Claude

###### 列出營銷活動

獲取  `https://urlkai.com/api/campaigns?limit=2&page=1`

要通過 API 獲取您的促銷活動，您可以使用此終端節點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/campaigns?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/campaigns?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/campaigns?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/campaigns?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/campaigns?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “campaigns”： [
            {
                “id”： 1，
                “name”： “示例營銷活動”，
                “public”： false，
                “rotator”： false，
                “list”： “https：\/\/domain.com\/u\/admin\/list-1”
            },
            {
                “id”：2、
                “domain”： “Facebook 活動”，
                “public”： true，
                “rotator”： “https：\/\/domain.com\/r\/test”， @旋轉器“，
                “清單”： “https：\/\/domain.com\/u\/admin\/test-2”
            }
        ]
    }
}
```

###### 創建營銷活動

發佈  `https://urlkai.com/api/campaign/add`

可以使用此終端節點添加活動。

| **參數** | **描述** |
| --- | --- |
| 名字 | （選擇）活動名稱 |
| 鼻涕蟲 | （選擇）Rotator Slug |
| 公共 | （選擇）訪問 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}'
```

```
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://urlkai.com/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": "New Campaign",
	    "slug": "new-campaign",
	    "public": true
	}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

```
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://urlkai.com/api/campaign/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
```

```
import requests
url = "https://urlkai.com/api/campaign/add"
payload = {
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}
headers = {
    'Authorization': 'Bearer YOURAPIKEY',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
```

```
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/campaign/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var content = new StringContent("{
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}", System.Text.Encoding.UTF8, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

###### 伺服器回應

```
{
    “error”： 0，
    「ID」：3，
    「領域」：「新戰役」，
    「公開」：正確，
    「旋轉者」：「https：\/\/domain.com\/r\/new-campaign」，
    「清單」：「https：\/\/domain.com\/u\/admin\/new-campaign-3」
}
```

###### 將連結分配給營銷活動

發佈  `https://urlkai.com/api/campaign/:campaignid/assign/:linkid`

可以使用此終端節點將短連結分配給營銷活動。終端節點需要活動ID和短連結ID。

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/campaign/:campaignid/assign/:linkid' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/campaign/:campaignid/assign/:linkid”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/campaign/:campaignid/assign/:linkid'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/campaign/:campaignid/assign/:linkid”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/campaign/:campaignid/assign/:linkid”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功將連結添加到營銷活動。”
}
```

###### 更新活動

放  `https://urlkai.com/api/campaign/:id/update`

要更新活動，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 名字 | （必填）活動名稱 |
| 鼻涕蟲 | （選擇）Rotator Slug |
| 公共 | （選擇）訪問 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/campaign/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “name”： “Twitter 活動”，
    “slug”： “推特活動”，
    “public”： true
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/campaign/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “name”： “Twitter 活動”，
	    “slug”： “推特活動”，
	    “public”： true
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/campaign/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “name”： “Twitter 活動”，
    “slug”： “推特活動”，
    “public”： true
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/campaign/:id/update”
有效載荷 = {
    “name”： “Twitter 活動”，
    “slug”： “推特活動”，
    “public”： true
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/campaign/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “name”： “Twitter 活動”，
    “slug”： “推特活動”，
    “public”： true
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”： 3，
    “domain”： “Twitter 活動”，
    “public”： true，
    “rotator”： “https：\/\/domain.com\/r\/twitter-campaign”，
    “list”： “https：\/\/domain.com\/u\/admin\/twitter-campaign-3”
}
```

###### 刪除活動

刪除  `https://urlkai.com/api/campaign/:id/delete`

要刪除活動，您需要發送 DELETE 請求。

cURL
PHP
Node.js
Python
C#

```
curl --location --request 刪除 'https://urlkai.com/api/campaign/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/campaign/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/campaign/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/campaign/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/campaign/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功刪除促銷活動。”
}
```

---

#### 管道 - Open in ChatGPT - Open in Claude

###### 列出頻道

獲取  `https://urlkai.com/api/channels?limit=2&page=1`

要通過 API 獲取管道，您可以使用此終端節點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/channels?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/channels?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/channels?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/channels?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/channels?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “頻道”：[
            {
                “id”： 1，
                “name”： “通道 1”， /
                “description”： 頻道 1 的描述“，
                “color”： “#000000”， /顏色
                “starred”： true
            },
            {
                “id”：2、
                “name”： “通道 2”， /
                “description”： 頻道 2 的描述“，
                “color”： “#FF0000”，
                “starred”： false
            }
        ]
    }
}
```

###### 列出頻道項

獲取  `https://urlkai.com/api/channel/:id?limit=1&page=1`

要通過 API 獲取選定管道中的專案，您可以使用此端點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/channel/:id?limit=1&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/channel/:id?limit=1&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/channel/:id?limit=1&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/channel/:id?limit=1&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/channel/:id?limit=1&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “items”： [
            {
                “type”： “連結”，
                “id”： 1，
                “title”： “我的樣本連結”，
                “preview”： “https：\/\/google.com”， //
                “link”： “https：\/\/urlkai.com\/google”， //google“，
                “date”： “2022-05-12”
            },
            {
                “type”： “生物”，
                “id”： 1，
                “title”： “我的樣本簡歷”，
                “preview”： “https：\/\/urlkai.com\/mybio”， //mybio
                “link”： “https：\/\/urlkai.com\/mybio”， /連結
                “date”： “2022-06-01”
            }
        ]
    }
}
```

###### 創建頻道

發佈  `https://urlkai.com/api/channel/add`

可以使用此終端節點添加通道。

| **參數** | **描述** |
| --- | --- |
| 名字 | （必填）頻道名稱 |
| 描述 | （選擇）頻道描述 |
| 顏色 | （選擇）通道徽章顏色 （HEX） |
| 主演 | （選擇）是否為頻道加星標（true 或 false） |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}'
```

```
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://urlkai.com/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": "New Channel",
	    "description": "my new channel",
	    "color": "#000000",
	    "starred": true
	}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

```
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://urlkai.com/api/channel/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
```

```
import requests
url = "https://urlkai.com/api/channel/add"
payload = {
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}
headers = {
    'Authorization': 'Bearer YOURAPIKEY',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
```

```
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/channel/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var content = new StringContent("{
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}", System.Text.Encoding.UTF8, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

###### 伺服器回應

```
{
    “error”： 0，
    「ID」：3，
    「名稱」：「新頻道」，
    「說明」：「我的新頻道」，
    「顏色」：「#000000」，
    「星級」：真實
}
```

###### 將專案分配給管道

發佈  `https://urlkai.com/api/channel/:channelid/assign/:type/:itemid`

通過發送包含頻道 ID、商品類型（連結、生物或 qr）和商品 ID 的請求，可以將商品分配給任何管道。

| **參數** | **描述** |
| --- | --- |
| ：channelid | （必填）頻道ID |
| ：類型 | （必需）鏈接或個人簡介或二維碼 |
| ：itemid | （必填）商品ID |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/channel/:channelid/assign/:type/:itemid' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/channel/:channelid/assign/:type/:itemid”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/channel/:channelid/assign/:type/:itemid'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/channel/:channelid/assign/:type/:itemid”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/channel/:channelid/assign/:type/:itemid”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “專案已成功添加到頻道。”
}
```

###### 更新頻道

放  `https://urlkai.com/api/channel/:id/update`

要更新通道，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 名字 | （選擇）頻道名稱 |
| 描述 | （選擇）頻道描述 |
| 顏色 | （選擇）通道徽章顏色 （HEX） |
| 主演 | （選擇）是否為頻道加星標（true 或 false） |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/channel/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “name”： “Acme Corp”， @名稱
    “description”： “Acme Corp 的商品頻道”，
    “color”： “#FFFFFF”，
    “starred”： false
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/channel/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “name”： “Acme Corp”， @名稱
	    “description”： “Acme Corp 的商品頻道”，
	    “color”： “#FFFFFF”，
	    “starred”： false
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/channel/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “name”： “Acme Corp”， @名稱
    “description”： “Acme Corp 的商品頻道”，
    “color”： “#FFFFFF”，
    “starred”： false
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/channel/:id/update”
有效載荷 = {
    “name”： “Acme Corp”， @名稱
    “description”： “Acme Corp 的商品頻道”，
    “color”： “#FFFFFF”，
    “starred”： false
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/channel/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “name”： “Acme Corp”， @名稱
    “description”： “Acme Corp 的商品頻道”，
    “color”： “#FFFFFF”，
    “starred”： false
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： 頻道已成功更新。
}
```

###### 刪除頻道

刪除  `https://urlkai.com/api/channel/:id/delete`

要刪除頻道，您需要發送 DELETE 請求。所有專案也將被取消分配。

cURL
PHP
Node.js
Python
C#

```
curl --location --request 刪除 'https://urlkai.com/api/channel/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/channel/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/channel/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/channel/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/channel/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： 頻道已成功刪除。
}
```

---

#### 自定義Splash - Open in ChatGPT - Open in Claude

###### 列出自定義啟動畫面

獲取  `https://urlkai.com/api/splash?limit=2&page=1`

要通過 API 獲取自訂啟動頁面，您可以使用此端點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/splash?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/splash?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/splash?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/splash?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/splash?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “splash”： [
            {
                “id”： 1，
                “name”： “產品 1 促銷”，
                “date”： “2020-11-10 18：00：00”
            },
            {
                “id”：2、
                “name”： “產品 2 促銷”，
                “date”： “2020-11-10 18：10：00”
            }
        ]
    }
}
```

---

#### 檔 - Open in ChatGPT - Open in Claude

###### 列出檔

獲取  `https://urlkai.com/api/files?limit=2&page=1`

獲取您的所有檔。您還可以按名稱搜索。

| **參數** | **描述** |
| --- | --- |
| 名字 | （選擇）按名稱搜索檔 |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/files?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
```

```
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://urlkai.com/api/files?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://urlkai.com/api/files?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);
});
```

```
import requests
url = "https://urlkai.com/api/files?limit=2&page=1"
payload = {}
headers = {
    'Authorization': 'Bearer YOURAPIKEY',
    'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, json=payload)
print(response.text)
```

```
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://urlkai.com/api/files?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

###### 伺服器回應

```
{
    "error": 0,
    "result": 3,
    "perpage": 15,
    "currentpage": 1,
    "nextpage": null,
    "maxpage": 1,
    "list": [
        {
            "id": 1,
            "name": "My Photo",
            "downloads": 10,
            "shorturl": "https:\/\/urlkai.com\/IQgGa",
            "date": "2022-08-09 17:00:00"
        },
        {
            "id": 2,
            "name": "My Documents",
            "downloads": 15,
            "shorturl": "https:\/\/urlkai.com\/QEsAa",
            "date": "2022-08-10 17:01:00"
        },
        {
            "id": 3,
            "name": "My Files",
            "downloads": 5,
            "shorturl": "https:\/\/urlkai.com\/lNWdv",
            "date": "2022-08-11 19:01:00"
        }
    ]
}
```

###### 上傳檔

發佈  `https://urlkai.com/api/files/upload/:filename?name=My+File`

通過將二進位數據作為post正文發送來上傳檔。您需要發送包含 extensions 而不是 url 中的 ：filename 的檔名（例如 brandkit.zip）。您可以通過發送以下參數來設置選項。

| **參數** | **描述** |
| --- | --- |
| 名字 | （選擇）檔名 |
| 習慣 | （選擇）自定義別名而不是隨機別名。 |
| 域 | （選擇）自訂域 |
| 密碼 | （選擇）密碼保護 |
| 滿期 | （選擇）下載示例的過期時間 2021-09-28 |
| 最大下載 | （選擇）最大下載次數 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/files/upload/:filename?name=My+File' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '"BINARY DATA"'
```

```
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://urlkai.com/api/files/upload/:filename?name=My+File",
    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 => 
        '"BINARY DATA"',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

```
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://urlkai.com/api/files/upload/:filename?name=My+File',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify("BINARY DATA"),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
```

```
import requests
url = "https://urlkai.com/api/files/upload/:filename?name=My+File"
payload = "BINARY DATA"
headers = {
    'Authorization': 'Bearer YOURAPIKEY',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
```

```
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://urlkai.com/api/files/upload/:filename?name=My+File");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var content = new StringContent(""BINARY DATA"", System.Text.Encoding.UTF8, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

###### 伺服器回應

```
{
    "error": 0,
    "id": 1,
    "shorturl": "https:\/\/urlkai.com\/MHQBw"
}
```

---

#### 連結 - Open in ChatGPT - Open in Claude

###### 列出連結

獲取  `https://urlkai.com/api/urls?limit=2&page=1o=date`

要通過 API 獲取連結，您可以使用此終端節點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |
| 次序 | （選擇）在日期之間對數據進行排序，或按兩下 |
| 短 | （選擇）使用短 URL 進行搜索。請注意，當您使用short參數時，所有其他參數都將被忽略，如果存在匹配項，將返回Single Link 回應。 |
| q | （選擇）使用關鍵字搜索連結 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/urls?limit=2&page=1o=date' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/urls?limit=2&page=1o=date”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/urls?limit=2&page=1o=date'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/urls?limit=2&page=1o=date”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/urls?limit=2&page=1o=date”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “urls”： [
            {
                “id”：2、
                “別名”： “google”，
                “shorturl”： “https：\/\/urlkai.com\/google”， //google“， /google”，
                “longurl”： “https：\/\/google.com”， //
                “clicks”： 0， 點擊
                “title”： “Google”， @標題
                “description”： “”， //
                “date”： “2020-11-10 18：01：43”
            },
            {
                “id”： 1，
                “別名”： “googlecanada”， @別名
                “shorturl”： “https：\/\/urlkai.com\/googlecanada”， //googlecanada
                “longurl”： “https：\/\/google.ca”， //
                “clicks”： 0， 點擊
                “title”： “Google 加拿大”，
                “description”： “”， //
                “date”： “2020-11-10 18：00：25”
            }
        ]
    }
}
```

###### 獲取單個連結

獲取  `https://urlkai.com/api/url/:id`

要通過 API 獲取單個連結的詳細資訊，您可以使用此終端節點。

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/url/:id' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/url/:id”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/url/:id'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/url/:id”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/url/:id”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”： 1，
    “詳細資訊”： {
        “id”： 1，
        “shorturl”： “https：\/\/urlkai.com\/googlecanada”， //googlecanada
        “longurl”： “https：\/\/google.com”， //
        “title”： “Google”， @標題
        “description”： “”， //
        “位置”： {
            “canada”： “https：\/\/google.ca”， /加拿大
            “美國”： “https：\/\/google.us”
        },
        “设备”： {
            “iPhone”： “https：\/\/google.com”，
            “android”： “https：\/\/google.com”
        },
        “expiry”： null，
        “date”： “2020-11-10 18：01：43”
    },
    “數據”： {
        “clicks”： 0， 點擊
        “uniqueClicks”： 0， uniqueClicks“： 0，
        “topCountries”： 0，
        “topReferrers”：0、
        “topBrowsers”：0、
        “topOs”： 0， 傳回
        “socialCount”： {
            “facebook”：0、
            “twitter”：0、
            “google”：0
        }
    }
}
```

###### 縮短連結

發佈  `https://urlkai.com/api/url/add`

要縮短連結，您需要通過 POST 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 網址 | （必填）要縮短的長URL。 |
| 習慣 | （選擇）自定義別名而不是隨機別名。 |
| 類型 | （選擇）重定向類型 [direct， frame， splash]，僅限 *身份證* 對於自定義初始頁或 *疊加層ID* 對於 CTA 頁面 |
| 密碼 | （選擇）密碼保護 |
| 域 | （選擇）自訂域 |
| 滿期 | （選擇）連結示例的過期時間 2021-09-28 23：11：16 |
| 地理定位 | （選擇）地理位置定位數據 |
| device目標 | （選擇）設備定位數據 |
| language目標 | （選擇）語言定位數據 |
| 元標題 | （選擇）元標題 |
| 元描述 | （選擇）元描述 |
| 元圖像 | （選擇）連結到 jpg 或 png 影像 |
| 描述 | （選擇）註釋或描述 |
| 圖元 | （選擇）圖元 ID 陣列 |
| 管道 | （選擇）頻道ID |
| 運動 | （選擇）推廣活動ID |
| 深度連結 | （可選）包含應用程式商店連結的物件。使用時，設定裝置目標也很重要。（新）你現在可以將參數「auto」設為 true，自動從提供的長連結中產生深度連結。 |
| 地位 | （選擇） *公共* 或 *private （預設）* |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/url/add' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “url”： “https：\/\/google.com”， ///
    “status”： “私有”，
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “metatitle”： “不是 Google”，
    “metadescription”： “非 Google 描述”，
    “metaimage”： “https：\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png”， //
    “description”： “對於 facebook”，
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “campaign”：1、
    “深度連結”： {
        “auto”： true 和
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “語言目標”： [
        {
            “language”： “en”， /中文
            “link”： “https：\/\/google.com”
        },
        {
            “language”： “fr”， /語言
            “link”： “https：\/\/google.ca”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/url/add”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “url”： “https：\/\/google.com”， ///
	    “status”： “私有”，
	    “custom”： “google”， /
	    “password”： “mypass”， /密碼
	    “expiry”： “2020-11-11 12：00：00”， /
	    “type”： “splash”， /
	    “metatitle”： “不是 Google”，
	    “metadescription”： “非 Google 描述”，
	    “metaimage”： “https：\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png”， //
	    “description”： “對於 facebook”，
	    “像素”： [
	        1,
	        2,
	        3,
	        4
	    ],
	    “channel”： 1，
	    “campaign”：1、
	    “深度連結”： {
	        “auto”： true 和
	        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
	        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
	    },
	    “地理目標”：[
	        {
	            “location”： “加拿大”，
	            “link”： “https：\/\/google.ca”
	        },
	        {
	            “location”： “美國”，
	            “link”： “https：\/\/google.us”
	        }
	    ],
	    “設備目標”： [
	        {
	            “device”： “iPhone”， @設備
	            “link”： “https：\/\/google.com”
	        },
	        {
	            “device”： “Android”， /設備
	            “link”： “https：\/\/google.com”
	        }
	    ],
	    “語言目標”： [
	        {
	            “language”： “en”， /中文
	            “link”： “https：\/\/google.com”
	        },
	        {
	            “language”： “fr”， /語言
	            “link”： “https：\/\/google.ca”
	        }
	    ],
	    “參數”： [
	        {
	            “名稱”： “aff”，
	            “value”： “3”
	        },
	        {
	            “device”： “gtm_source”，
	            “link”： “api”
	        }
	    ]
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/url/add'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “url”： “https：\/\/google.com”， ///
    “status”： “私有”，
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “metatitle”： “不是 Google”，
    “metadescription”： “非 Google 描述”，
    “metaimage”： “https：\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png”， //
    “description”： “對於 facebook”，
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “campaign”：1、
    “深度連結”： {
        “auto”： true 和
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “語言目標”： [
        {
            “language”： “en”， /中文
            “link”： “https：\/\/google.com”
        },
        {
            “language”： “fr”， /語言
            “link”： “https：\/\/google.ca”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/url/add”
有效載荷 = {
    “url”： “https://google.com”，
    “status”： “私有”，
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “metatitle”： “不是 Google”，
    “metadescription”： “非 Google 描述”，
    “metaimage”： “https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png”， /元圖像
    “description”： “對於 facebook”，
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “campaign”：1、
    “深度連結”： {
        “auto”： true 和
        “apple”： “https://apps.apple.com/us/app/google/id284815942”，
        “google”： “https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=美國”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https://google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https://google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https://google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https://google.com”
        }
    ],
    “語言目標”： [
        {
            “language”： “en”， /中文
            “link”： “https://google.com”
        },
        {
            “language”： “fr”， /語言
            “link”： “https://google.ca”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/url/add”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “url”： “https：\/\/google.com”， ///
    “status”： “私有”，
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “metatitle”： “不是 Google”，
    “metadescription”： “非 Google 描述”，
    “metaimage”： “https：\/\/www.mozilla.org\/media\/protocol\/img\/logos\/firefox\/browser\/og.4ad05d4125a5.png”， //
    “description”： “對於 facebook”，
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “campaign”：1、
    “深度連結”： {
        “auto”： true 和
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “語言目標”： [
        {
            “language”： “en”， /中文
            “link”： “https：\/\/google.com”
        },
        {
            “language”： “fr”， /語言
            “link”： “https：\/\/google.ca”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”： 3，
    “shorturl”： “https：\/\/urlkai.com\/google”
}
```

###### 更新連結

放  `https://urlkai.com/api/url/:id/update`

要更新連結，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 網址 | （必填）要縮短的長URL。 |
| 習慣 | （選擇）自定義別名而不是隨機別名。 |
| 類型 | （選擇）重定向類型 [direct， frame， splash] |
| 密碼 | （選擇）密碼保護 |
| 域 | （選擇）自訂域 |
| 滿期 | （選擇）連結示例的過期時間 2021-09-28 23：11：16 |
| 地理定位 | （選擇）地理位置定位數據 |
| device目標 | （選擇）設備定位數據 |
| language目標 | （選擇）語言定位數據 |
| 元標題 | （選擇）元標題 |
| 元描述 | （選擇）元描述 |
| 元圖像 | （選擇）連結到 jpg 或 png 影像 |
| 圖元 | （選擇）圖元 ID 陣列 |
| 管道 | （選擇）頻道ID |
| 運動 | （選擇）推廣活動ID |
| 深度連結 | （選擇）包含應用商店連結的物件。使用此功能時，設置設備定位也很重要。 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/url/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “url”： “https：\/\/google.com”， ///
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “深度連結”： {
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/url/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “url”： “https：\/\/google.com”， ///
	    “custom”： “google”， /
	    “password”： “mypass”， /密碼
	    “expiry”： “2020-11-11 12：00：00”， /
	    “type”： “splash”， /
	    “像素”： [
	        1,
	        2,
	        3,
	        4
	    ],
	    “channel”： 1，
	    “深度連結”： {
	        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
	        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
	    },
	    “地理目標”：[
	        {
	            “location”： “加拿大”，
	            “link”： “https：\/\/google.ca”
	        },
	        {
	            “location”： “美國”，
	            “link”： “https：\/\/google.us”
	        }
	    ],
	    “設備目標”： [
	        {
	            “device”： “iPhone”， @設備
	            “link”： “https：\/\/google.com”
	        },
	        {
	            “device”： “Android”， /設備
	            “link”： “https：\/\/google.com”
	        }
	    ],
	    “參數”： [
	        {
	            “名稱”： “aff”，
	            “value”： “3”
	        },
	        {
	            “device”： “gtm_source”，
	            “link”： “api”
	        }
	    ]
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/url/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “url”： “https：\/\/google.com”， ///
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “深度連結”： {
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/url/:id/update”
有效載荷 = {
    “url”： “https://google.com”，
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “深度連結”： {
        “apple”： “https://apps.apple.com/us/app/google/id284815942”，
        “google”： “https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA≷=美國”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https://google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https://google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https://google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https://google.com”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/url/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “url”： “https：\/\/google.com”， ///
    “custom”： “google”， /
    “password”： “mypass”， /密碼
    “expiry”： “2020-11-11 12：00：00”， /
    “type”： “splash”， /
    “像素”： [
        1,
        2,
        3,
        4
    ],
    “channel”： 1，
    “深度連結”： {
        “apple”： “https：\/\/apps.apple.com\/us\/app\/google\/id284815942”， //id284815942
        “google”： “https：\/\/play.google.com\/store\/apps\/details？id=com.google.android.googlequicksearchbox&hl=en_CA≷=US”
    },
    “地理目標”：[
        {
            “location”： “加拿大”，
            “link”： “https：\/\/google.ca”
        },
        {
            “location”： “美國”，
            “link”： “https：\/\/google.us”
        }
    ],
    “設備目標”： [
        {
            “device”： “iPhone”， @設備
            “link”： “https：\/\/google.com”
        },
        {
            “device”： “Android”， /設備
            “link”： “https：\/\/google.com”
        }
    ],
    “參數”： [
        {
            “名稱”： “aff”，
            “value”： “3”
        },
        {
            “device”： “gtm_source”，
            “link”： “api”
        }
    ]
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”： 3，
    “short”： “https：\/\/urlkai.com\/google”
}
```

###### 刪除連結

刪除  `https://urlkai.com/api/url/:id/delete`

要刪除連結，您需要發送 DELETE 請求。

cURL
PHP
Node.js
Python
C#

```
curl --location --request 刪除 'https://urlkai.com/api/url/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/url/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/url/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/url/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/url/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功刪除連結”
}
```

---

#### 圖元 - Open in ChatGPT - Open in Claude

###### 列出圖元

獲取  `https://urlkai.com/api/pixels?limit=2&page=1`

要通過 API 獲取像素代碼，您可以使用此端點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/pixels?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/pixels?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/pixels?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/pixels?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/pixels?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “像素”： [
            {
                “id”： 1，
                “type”： “gtmpixel”， /
                “name”： “GTM 圖元”，
                “標籤”： “GA-123456789”， /標籤“： ”GA-123456789“，
                “date”： “2020-11-10 18：00：00”
            },
            {
                “id”：2、
                “type”： “twitterpixel”， /
                “name”： “Twitter 圖元”，
                “tag”： “1234567”， @標籤
                “date”： “2020-11-10 18：10：00”
            }
        ]
    }
}
```

###### 創建 Pixel 像素代碼

發佈  `https://urlkai.com/api/pixel/add`

可以使用此端點創建圖元。您需要發送像素類型和標籤。

| **參數** | **描述** |
| --- | --- |
| 類型 | （必需） GTMepL |Gapixel 像素 |FB像素 |AdWords 像素 |領英圖元 |推特圖元 |廣告圖元 |QuoraPixel 像素代碼 |Pinterest 公司 |必應 |Snapchat 的 |Reddit |抖音 |
| 名字 | （必填）圖元的自定義名稱 |
| 標記 | （必填）像素的標籤 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/pixel/add' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “type”： “gtmpixel”， /
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/pixel/add”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “type”： “gtmpixel”， /
	    “name”： “我的 GTM”，
	    “tag”： “GTM-ABCDE”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/pixel/add' ，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “type”： “gtmpixel”， /
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/pixel/add”
有效載荷 = {
    “type”： “gtmpixel”， /
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/pixel/add”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “type”： “gtmpixel”， /
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”：1
}
```

###### 更新 Pixel 像素代碼

放  `https://urlkai.com/api/pixel/:id/update`

要更新 Pixel 像素代碼，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 名字 | （選擇）圖元的自定義名稱 |
| 標記 | （必填）像素的標籤 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/pixel/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/pixel/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “name”： “我的 GTM”，
	    “tag”： “GTM-ABCDE”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/pixel/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/pixel/:id/update”
有效載荷 = {
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/pixel/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “name”： “我的 GTM”，
    “tag”： “GTM-ABCDE”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “Pixel 已成功更新。”
}
```

###### 刪除圖元

刪除  `https://urlkai.com/api/pixel/:id/delete`

要刪除圖元，您需要發送 DELETE 請求。

cURL
PHP
Node.js
Python
C#

```
curl --location --request 刪除 'https://urlkai.com/api/pixel/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/pixel/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/pixel/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/pixel/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/pixel/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功刪除Pixel。”
}
```

---

#### 二維碼 - Open in ChatGPT - Open in Claude

###### 列出二維碼

獲取  `https://urlkai.com/api/qr?limit=2&page=1`

要通過 API 獲取 QR 碼，您可以使用此終端節點。您還可以篩選數據（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 限制 | （選擇）每頁數據結果 |
| 頁 | （選擇）當前頁面請求 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/qr?limit=2&page=1' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/qr?limit=2&page=1”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/qr?limit=2&page=1'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/qr?limit=2&page=1”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/qr?limit=2&page=1”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “error”： “0”， /錯誤“： ”0“，
    “數據”： {
        “result”： 2，
        “perpage”： 2，
        “currentpage”： 1，
        “nextpage”： 1，
        “maxpage”： 1，
        “qrs”：[
            {
                “id”：2、
                “link”： “https：\/\/urlkai.com\/qr\/a2d5e”，
                “scans”： 0，
                “name”： “Google”， /中文
                “date”： “2020-11-10 18：01：43”
            },
            {
                “id”： 1，
                “link”： “https：\/\/urlkai.com\/qr\/b9edfe”，
                “scans”：5、
                “name”： “Google 加拿大”，
                “date”： “2020-11-10 18：00：25”
            }
        ]
    }
}
```

###### 獲取單個 QR 碼

獲取  `https://urlkai.com/api/qr/:id`

要通過 API 獲取單個 QR 碼的詳細資訊，您可以使用此終端節點。

cURL
PHP
Node.js
Python
C#

```
curl --location --request GET 'https://urlkai.com/api/qr/:id' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/qr/:id”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “GET”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： 'GET'， @方法
    'url'： 'https://urlkai.com/api/qr/:id'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/qr/:id”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“GET”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Get， “https://urlkai.com/api/qr/:id”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “詳細資訊”： {
        “id”： 1，
        “link”： “https：\/\/urlkai.com\/qr\/b9edfe”，
        “scans”：5、
        “name”： “Google 加拿大”，
        “date”： “2020-11-10 18：00：25”
    },
    “數據”： {
        “clicks”： 1，
        “uniqueClicks”： 1，
        “topCountries”： {
            “未知”： “1”
        },
        “topReferrers”：{
            “Direct， email and other”： “1”
        },
        “topBrowsers”：{
            “Chrome”： “1”
        },
        “topOs”： {
            “Windows 10”： “1”
        },
        “socialCount”： {
            “facebook”：0、
            “twitter”：0、
            “Instagram”：0
        }
    }
}
```

###### 創建 QR 碼

發佈  `https://urlkai.com/api/qr/add`

要創建 QR 碼，您需要通過 POST 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 類型 | （必填） text |電子名片 |連結 |電子郵件 |電話 |短信 |無線網路 |
| 數據 | （必填）要嵌入二維碼中的數據。數據可以是字串或陣列，具體取決於類型 |
| 背景 | （選擇）RGB 顏色，例如 rgb（255,255,255） |
| 前景 | （選擇）RGB 顏色，例如 rgb（0,0,0） |
| 商標 | （選擇）徽標的路徑 png 或 jpg |
| 名字 | （選擇）二維碼名稱 |

cURL
PHP
Node.js
Python
C#

```
curl --location --request POST 'https://urlkai.com/api/qr/add' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”，
    “name”： “二維碼 API”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/qr/add”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “POST”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “type”： “連結”，
	    “data”： “https：\/\/google.com”， ///
	    “background”： “rgb（255,255,255）”， /
	    “foreground”： “rgb（0,0,0）”， /
	    “徽標”： “https：\/\/site.com\/logo.png”，
	    “name”： “二維碼 API”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '發佈'，
    'url'： 'https://urlkai.com/api/qr/add'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”，
    “name”： “二維碼 API”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/qr/add”
有效載荷 = {
    “type”： “連結”，
    “data”： “https://google.com”， /數據
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “logo”： “https://site.com/logo.png”，
    “name”： “二維碼 API”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“POST”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var request = new HttpRequestMessage（HttpMethod.Post， “https://urlkai.com/api/qr/add”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”，
    “name”： “二維碼 API”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “id”： 3，
    “link”： “https：\/\/urlkai.com\/qr\/a58f79”
}
```

###### 更新二維碼

放  `https://urlkai.com/api/qr/:id/update`

要更新 QR 碼，您需要通過 PUT 請求以 JSON 格式發送有效數據。數據必須作為請求的原始正文發送，如下所示。下面的示例顯示了您可以發送的所有參數，但您不需要發送所有參數（有關更多資訊，請參閱表格）。

| **參數** | **描述** |
| --- | --- |
| 數據 | （必填）要嵌入二維碼中的數據。數據可以是字串或陣列，具體取決於類型 |
| 背景 | （選擇）RGB 顏色，例如 rgb（255,255,255） |
| 前景 | （選擇）RGB 顏色，例如 rgb（0,0,0） |
| 商標 | （選擇）徽標的路徑 png 或 jpg |

cURL
PHP
Node.js
Python
C#

```
curl --location --request PUT 'https://urlkai.com/api/qr/:id/update' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
--data-raw '{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”
}'
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/qr/:id/update”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “PUT”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    CURLOPT_POSTFIELDS =>
        '{
	    “type”： “連結”，
	    “data”： “https：\/\/google.com”， ///
	    “background”： “rgb（255,255,255）”， /
	    “foreground”： “rgb（0,0,0）”， /
	    “徽標”： “https：\/\/site.com\/logo.png”
	}',
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '放'，
    'url'： 'https://urlkai.com/api/qr/:id/update'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    正文：JSON.stringify（{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”
}),
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/qr/:id/update”
有效載荷 = {
    “type”： “連結”，
    “data”： “https://google.com”， /數據
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “logo”： “https://site.com/logo.png”
}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
response = requests.request（“PUT”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Put， “https://urlkai.com/api/qr/:id/update”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{
    “type”： “連結”，
    “data”： “https：\/\/google.com”， ///
    “background”： “rgb（255,255,255）”， /
    “foreground”： “rgb（0,0,0）”， /
    “徽標”： “https：\/\/site.com\/logo.png”
}“， System.Text.Encoding.UTF8， ”應用程式/json“）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “二維碼已成功更新。”
}
```

###### 刪除 QR 碼

刪除  `https://urlkai.com/api/qr/:id/delete`

要刪除 QR 碼，您需要發送 DELETE 請求。

cURL
PHP
Node.js
Python
C#

```
curl --location --request DELETE 'https://urlkai.com/api/qr/:id/delete' \
--header '授權：持有者 YOURAPIKEY' \
--header '內容類型： application/json' \
```

```
$curl = curl_init（）;

curl_setopt_array（$curl， 陣列（
    CURLOPT_URL => “https://urlkai.com/api/qr/:id/delete”，
    CURLOPT_RETURNTRANSFER => true，
    CURLOPT_MAXREDIRS => 2，
    CURLOPT_TIMEOUT => 10，
    CURLOPT_FOLLOWLOCATION => true，
    CURLOPT_CUSTOMREQUEST => “刪除”，
    CURLOPT_HTTPHEADER => [
        “授權：Bearer YOURAPIKEY”，
        “內容類型：application/json”，
    ],
    
));

$response = curl_exec（$curl）;

curl_close（$curl）;
回聲$response;
```

```
var 請求 = require（'request'）;
var 選項 = {
    'method'： '刪除'，
    'url'： 'https://urlkai.com/api/qr/:id/delete'，
    '標頭'： {
        '授權'： 'Bearer YOURAPIKEY'，
        '內容類型'： 'application/json'
    },
    
};
request（options， function （error， response） {
    if （error） throw new Error（error）;
    console.log（response.body）;
});
```

```
匯入請求
url = “https://urlkai.com/api/qr/:id/delete”
有效載荷 = {}
標頭 = {
    '授權'： 'Bearer YOURAPIKEY'，
    '內容類型'： 'application/json'
}
回應 = requests.request（“DELETE”， url， headers=headers， json=payload）
print（response.text） 的
```

```
var client = new HttpClient（）;
var 請求 = new HttpRequestMessage（HttpMethod.Delete， “https://urlkai.com/api/qr/:id/delete”）;
請求。Headers.Add（“授權”， “持有者 YOURAPIKEY”）;
var content = new StringContent（“{}”， System.Text.Encoding.UTF8， “application/json”）;
請求。內容 = 內容;
var 回應 = await 用戶端。SendAsync（請求）;
回應。EnsureSuccessStatusCode（）;
Console.WriteLine（await 回應。Content.ReadAsStringAsync（））;
```

###### 伺服器回應

```
{
    “錯誤”： 0，
    “message”： “已成功刪除 QR 碼。”
}
```