GET 方法
当你希望从脚本或自动化工具发起简单直接的请求时,请使用查询参数。
GET https://api.dlvrify.com/shorten?account_code=YOUR_ACCOUNT_CODE&url=https%3A%2F%2Fexample.com&alias=my-link直接使用你现有的账号码创建短链接。该接口同时支持 GET 和 POST 请求。
当你希望从脚本或自动化工具发起简单直接的请求时,请使用查询参数。
GET https://api.dlvrify.com/shorten?account_code=YOUR_ACCOUNT_CODE&url=https%3A%2F%2Fexample.com&alias=my-link当你希望使用更整洁且更易扩展的负载时,请使用 JSON 或表单 POST 请求。
POST https://api.dlvrify.com/shorten
Content-Type: application/json
{
"account_code": "YOUR_ACCOUNT_CODE",
"url": "https://example.com",
"alias": "my-link"
}| Field | 类型 | 状态 | 说明 |
|---|---|---|---|
account_code | string | required | 你现有的匿名登录账号码。 |
url | string | required | 要缩短的目标 URL。 |
alias | string | optional | 自定义别名。留空则自动生成。 |
title | string | optional | 链接的可选内部标题。 |
notes | string | optional | 随链接保存的可选备注。 |
click_limit | integer | optional | 到期前的可选最大点击次数。 |
expires_at | string | optional | 可选到期时间,格式为 YYYY-MM-DDTHH:MM。 |
{
"ok": true,
"message": "Short URL created.",
"data": {
"id": 12,
"code": "my-link",
"short_url": "https://dlvrify.com/my-link",
"destination_url": "https://example.com"
}
}使用创建匿名账户时得到的同一个账号码,不需要单独的 API key。