短链接

get

Get all short urls

授权
响应
200
success
application/json
get
GET /v1/link HTTP/1.1
Host: api.power301.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "data": [
    {
      "id": "72288a61-034e-4596-80c9-88751cf0a937",
      "host": "www.example.com",
      "url": "www.example.com",
      "alias": "aBD",
      "https": true,
      "destination": "https://www.google.com",
      "destinations": "[]",
      "type": "301",
      "status": "active",
      "forward_query": false,
      "created_at": "2023-11-15T15:09:14.000000Z",
      "updated_at": "2023-11-15T15:09:14.000000Z"
    }
  ]
}

create short url

post
授权
请求体
hoststring必填

Hostname

Example: url.com
aliasstring可选

Slug

Example: 123
destinationstring必填

Destination URL

Example: https://www.google.com
typestring可选

Type

Example: 301
forward_queryboolean可选

whether forwarding query params to destination

Example: false
响应
200
success
application/json
post
POST /v1/link HTTP/1.1
Host: api.power301.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 106

{
  "host": "url.com",
  "alias": "123",
  "destination": "https://www.google.com",
  "type": "301",
  "forward_query": false
}
200

success

{
  "data": null
}
get
授权
路径参数
idstring · string必填

short url id

Example: 1639562002248499321
响应
200
success
application/json
get
GET /v1/link/{id} HTTP/1.1
Host: api.power301.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "id": "72288a61-034e-4596-80c9-88751cf0a937",
  "host": "www.example.com",
  "url": "www.example.com",
  "alias": "aBD",
  "https": true,
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "status": "active",
  "forward_query": false,
  "created_at": "2023-11-15T15:09:14.000000Z",
  "updated_at": "2023-11-15T15:09:14.000000Z"
}
put
授权
路径参数
idstring · string必填

short url id

Example: 1639562002248499321
请求体
hoststring必填

Hostname

Example: url.com
aliasstring可选

Slug

Example: 123
destinationstring必填

Destination URL

Example: https://www.google.com
typestring可选

Type

Example: 301
forward_queryboolean可选

whether forwarding query params to destination

Example: false
响应
200
success
application/json
put
PUT /v1/link/{id} HTTP/1.1
Host: api.power301.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 106

{
  "host": "url.com",
  "alias": "123",
  "destination": "https://www.google.com",
  "type": "301",
  "forward_query": false
}
200

success

{
  "data": null
}
delete
授权
路径参数
idstring · string必填

short url id

Example: 1639562002248499321
响应
200
success
application/json
delete
DELETE /v1/link/{id} HTTP/1.1
Host: api.power301.com
Authorization: YOUR_API_KEY
Accept: */*
200

success

{
  "data": null
}

这有帮助吗?