Developers

Referensi API untuk Pengembang

An API key is required for requests to be processed by the system. Once a user registers, an API key is automatically generated for this user.

穆萊

Kunci API diperlukan agar permintaan diproses oleh sistem.Setelah pengguna mendaftar, kunci API secara otomatis dibuat untuk pengguna ini.Kunci API harus dikirim dengan setiap permintaan (lihat contoh lengkap di bawah).Jika kunci API tidak dikirim atau kedaluwarsa, akan terjadi kesalahan.Pastikan untuk merahasiakan kunci API Anda untuk mencegah penyalahgunaan.

奧特尼卡西

Untuk mengautentikasi dengan sistem API, Anda perlu mengirim kunci API sebagai token otorisasi dengan setiap permintaan.Anda dapat melihat contoh kode di bawah ini.

curl --location --request POST 'https://urlkai.com/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \ 

巴塔斯塔斯

API kami memiliki pembatas kecepatan untuk melindungi dari lonjakan permintaan untuk memaksimalkan stabilitasnya.Pembatas tarif kami saat ini dibatasi pada 30 permintaan per 1 menit.請注意,費率可能會根據訂閱的計劃而變化。

Beberapa tajuk akan dikirim bersama respons dan ini dapat diperiksa untuk menentukan berbagai informasi tentang permintaan.

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

檳榔嶼 Respon

Semua respons API dikembalikan dalam format JSON secara default.Untuk mengubah ini menjadi data yang dapat digunakan, fungsi yang sesuai perlu digunakan sesuai dengan bahasa.Di PHP, fungsi json_decode() dapat digunakan untuk mengonversi data menjadi objek (default) atau array (setel parameter kedua ke true).Sangat penting untuk memeriksa kunci kesalahan karena memberikan informasi apakah ada kesalahan atau tidak.Anda juga dapat memeriksa kode header.

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

達派特坎阿昆

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

Untuk mendapatkan informasi tentang akun, Anda dapat mengirim permintaan ke titik akhir ini dan itu akan mengembalikan data pada akun.

curl --location --request GET 'https://urlkai.com/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "data": {
        "id": 1,
        "email": "[email protected]",
        "username": "sampleuser",
        "avatar": "https:\/\/domain.com\/content\/avatar.png",
        "status": "pro",
        "expires": "2022-11-15 15:00:00",
        "registered": "2020-11-10 18:01:43"
    }
}

Perbaharui akun

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

Untuk memperbarui informasi di akun, Anda dapat mengirim permintaan ke titik akhir ini dan itu akan memperbarui data di akun.

curl --location --request PUT 'https://urlkai.com/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "NewPassword1"
}'

Tanggapan 伺服器

{
    "error": 0,
    "message": "Account has been successfully updated."
}

Domain Bermerek

列出品牌域

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "domains": [
            {
                "id": 1,
                "domain": "https:\/\/domain1.com",
                "redirectroot": "https:\/\/rootdomain.com",
                "redirect404": "https:\/\/rootdomain.com\/404"
            },
            {
                "id": 2,
                "domain": "https:\/\/domain2.com",
                "redirectroot": "https:\/\/rootdomain2.com",
                "redirect404": "https:\/\/rootdomain2.com\/404"
            }
        ]
    }
}

創建品牌域

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

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

參數 凱特蘭甘
域 (必填)品牌域,包括 HTTP 或 HTTPs
重定向根 (選擇)當有人訪問您的域時進行根重定向
重定向404 (選擇)自定義 404 重定向
curl --location --request POST 'https://urlkai.com/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 1
}

Perbarui 域

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

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

參數 凱特蘭甘
重定向根 (選擇)當有人訪問您的域時進行根重定向
重定向404 (選擇)自定義 404 重定向
curl --location --request PUT 'https://urlkai.com/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}'

Tanggapan 伺服器

{
    "error": 0,
    "message": "Domain has been updated successfully."
}

刪除域

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

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

curl --location --request DELETE 'https://urlkai.com/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Domain has been deleted successfully."
}

列出檔

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

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

參數 凱特蘭甘
名字 (選擇)按名稱搜索檔
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/files?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "result": 3,
    "perpage": 15,
    "currentpage": 1,
    "nextpage": null,
    "maxpage": 1,
    "list": [
        {
            "id": 1,
            "name": "My Photo",
            "downloads": 10,
            "shorturl": "https:\/\/urlkai.com\/cyhbP",
            "date": "2022-08-09 17:00:00"
        },
        {
            "id": 2,
            "name": "My Documents",
            "downloads": 15,
            "shorturl": "https:\/\/urlkai.com\/WmPHg",
            "date": "2022-08-10 17:01:00"
        },
        {
            "id": 3,
            "name": "My Files",
            "downloads": 5,
            "shorturl": "https:\/\/urlkai.com\/ljOwk",
            "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 --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"'

Tanggapan 伺服器

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

漢帕蘭 CTA

列出 CTA 疊加

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "cta": [
            {
                "id": 1,
                "type": "message",
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "contact",
                "name": "Contact Page",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

坎潘耶

列出營銷活動

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/campaigns?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "campaigns": [
            {
                "id": 1,
                "name": "Sample Campaign",
                "public": false,
                "rotator": false,
                "list": "https:\/\/domain.com\/u\/admin\/list-1"
            },
            {
                "id": 2,
                "domain": "Facebook Campaign",
                "public": true,
                "rotator": "https:\/\/domain.com\/r\/test",
                "list": "https:\/\/domain.com\/u\/admin\/test-2"
            }
        ]
    }
}

Buat Kampanye

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

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

參數 凱特蘭甘
名字 (選擇)活動名稱
鼻涕蟲 (選擇)Rotator Slug
公共 (選擇)訪問
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
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 3,
    "domain": "New Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/new-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/new-campaign-3"
}
發佈 https://urlkai.com/api/campaign/:campaignid/assign/:linkid

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

curl --location --request POST 'https://urlkai.com/api/campaign/:campaignid/assign/:linkid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Link successfully added to the campaign."
}

Perbarui Kampanye

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

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

參數 凱特蘭甘
名字 (必填)活動名稱
鼻涕蟲 (選擇)Rotator Slug
公共 (選擇)訪問
curl --location --request PUT 'https://urlkai.com/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Twitter Campaign",
    "slug": "twitter-campaign",
    "public": true
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 3,
    "domain": "Twitter Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/twitter-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/twitter-campaign-3"
}

刪除活動

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

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

curl --location --request DELETE 'https://urlkai.com/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Campaign has been deleted successfully."
}

科德二維碼

列出二維碼

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

Untuk mendapatkan kode QR Anda melalui API, Anda dapat menggunakan titik akhir ini.Anda juga dapat memfilter data (Lihat tabel untuk info selengkapnya).

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "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 Canada",
                "date": "2020-11-10 18:00:25"
            }
        ]
    }
}

Dapatkan satu Kode QR

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

Untuk mendapatkan detail untuk satu kode QR melalui API, Anda dapat menggunakan titik akhir ini.

curl --location --request GET 'https://urlkai.com/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "details": {
        "id": 1,
        "link": "https:\/\/urlkai.com\/qr\/b9edfe",
        "scans": 5,
        "name": "Google Canada",
        "date": "2020-11-10 18:00:25"
    },
    "data": {
        "clicks": 1,
        "uniqueClicks": 1,
        "topCountries": {
            "Unknown": "1"
        },
        "topReferrers": {
            "Direct, email and other": "1"
        },
        "topBrowsers": {
            "Chrome": "1"
        },
        "topOs": {
            "Windows 10": "1"
        },
        "socialCount": {
            "facebook": 0,
            "twitter": 0,
            "instagram": 0
        }
    }
}

Buat Kode 二維碼

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

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

參數 凱特蘭甘
類型 (必填) text |電子名片 |連結 |電子郵件 |電話 |短信 |無線網路
數據 (必填)要嵌入二維碼中的數據。數據可以是字串或陣列,具體取決於類型
背景 (選擇)RGB 顏色,例如 rgb(255,255,255)
前景 (選擇)RGB 顏色,例如 rgb(0,0,0)
商標 (選擇)徽標的路徑 png 或 jpg
名字 (選擇)二維碼名稱
curl --location --request POST 'https://urlkai.com/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png",
    "name": "QR Code API"
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 3,
    "link": "https:\/\/urlkai.com\/qr\/a58f79"
}

更新二維碼

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

Untuk memperbarui Kode QR, Anda perlu mengirim data yang valid di JSON melalui permintaan PUT.Data harus dikirim sebagai badan mentah permintaan Anda seperti yang ditunjukkan di bawah ini.Contoh di bawah ini menunjukkan semua parameter yang dapat Anda kirim tetapi Anda tidak diharuskan untuk mengirim semua (Lihat tabel untuk info lebih lanjut).

參數 凱特蘭甘
數據 (必填)要嵌入二維碼中的數據。數據可以是字串或陣列,具體取決於類型
背景 (選擇)RGB 顏色,例如 rgb(255,255,255)
前景 (選擇)RGB 顏色,例如 rgb(0,0,0)
商標 (選擇)徽標的路徑 png 或 jpg
curl --location --request PUT 'https://urlkai.com/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'

Tanggapan 伺服器

{
    "error": 0,
    "message": "QR has been updated successfully."
}

Hapus Kode 二維碼

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

Untuk menghapus kode QR, Anda perlu mengirim permintaan DELETE.

curl --location --request DELETE 'https://urlkai.com/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "QR Code has been deleted successfully."
}

Pembuka Kustom

列出自定義啟動畫面

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

To get Splash Pages via the API, you can use this endpoint. You can also filter data (See table for more info).

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "splash": [
            {
                "id": 1,
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "name": "Product 2 Promo",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

皮克塞爾

列出圖元

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "pixels": [
            {
                "id": 1,
                "type": "gtmpixel",
                "name": "GTM Pixel",
                "tag": "GA-123456789",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "twitterpixel",
                "name": "Twitter Pixel",
                "tag": "1234567",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

創建 Pixel 像素代碼

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

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

參數 凱特蘭甘
類型 (必需) GTMepL |Gapixel 像素 |FB像素 |AdWords 像素 |領英圖元 |推特圖元 |廣告圖元 |QuoraPixel 像素代碼 |Pinterest 公司 |必應 |Snapchat 的 |Reddit |抖音
名字 (必填)圖元的自定義名稱
標記 (必填)像素的標籤
curl --location --request POST 'https://urlkai.com/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 1
}

Perbarui Piksel

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

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

參數 凱特蘭甘
名字 (選擇)圖元的自定義名稱
標記 (必填)像素的標籤
curl --location --request PUT 'https://urlkai.com/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'

Tanggapan 伺服器

{
    "error": 0,
    "message": "Pixel has been updated successfully."
}

刪除圖元

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

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

curl --location --request DELETE 'https://urlkai.com/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Pixel has been deleted successfully."
}

薩魯蘭

列出頻道

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/channels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "channels": [
            {
                "id": 1,
                "name": "Channel 1",
                "description": "Description of channel 1",
                "color": "#000000",
                "starred": true
            },
            {
                "id": 2,
                "name": "Channel 2",
                "description": "Description of channel 2",
                "color": "#FF0000",
                "starred": false
            }
        ]
    }
}

列出頻道項

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

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

參數 凱特蘭甘
限制 (選擇)每頁數據結果
頁 (選擇)當前頁面請求
curl --location --request GET 'https://urlkai.com/api/channel/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "items": [
            {
                "type": "links",
                "id": 1,
                "title": "My Sample Link",
                "preview": "https:\/\/google.com",
                "link": "https:\/\/urlkai.com\/google",
                "date": "2022-05-12"
            },
            {
                "type": "bio",
                "id": 1,
                "title": "My Sample Bio",
                "preview": "https:\/\/urlkai.com\/mybio",
                "link": "https:\/\/urlkai.com\/mybio",
                "date": "2022-06-01"
            }
        ]
    }
}

Buat Saluran

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

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

參數 凱特蘭甘
名字 (必填)頻道名稱
描述 (選擇)頻道描述
顏色 (選擇)通道徽章顏色 (HEX)
主演 (選擇)是否為頻道加星標(true 或 false)
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
}'

Tanggapan 伺服器

{
    "error": 0,
    "id": 3,
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}

將專案分配給管道

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

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

參數 凱特蘭甘
:channelid (必填)頻道ID
:類型 (必需)鏈接或個人簡介或二維碼
:itemid (必填)商品ID
curl --location --request POST 'https://urlkai.com/api/channel/:channelid/assign/:type/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Item successfully added to the channel."
}

Perbarui Saluran

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

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

參數 凱特蘭甘
名字 (選擇)頻道名稱
描述 (選擇)頻道描述
顏色 (選擇)通道徽章顏色 (HEX)
主演 (選擇)是否為頻道加星標(true 或 false)
curl --location --request PUT 'https://urlkai.com/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Acme Corp",
    "description": "channel for items for Acme Corp",
    "color": "#FFFFFF",
    "starred": false
}'

Tanggapan 伺服器

{
    "error": 0,
    "message": "Channel has been updated successfully."
}

刪除頻道

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

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

curl --location --request DELETE 'https://urlkai.com/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \

Tanggapan 伺服器

{
    "error": 0,
    "message": "Channel has been deleted successfully."
}