⚙️
Power301 API 文档
  • 欢迎使用Power301开发者文档!
  • 快速开始
  • API 参考
    • 重定向
    • 域名
    • 短链接
    • 账户
    • 工作区
      • 订阅
  • Specification
由 GitBook 提供支持
在本页

这有帮助吗?

  1. API 参考

重定向

上一页API 参考下一页域名

这有帮助吗?

Get details about a specific redirect by id

get
授权
路径参数
idstring · string必填

redirect id

Example: 1639562002248499321
响应
200
success
application/json
get
GET /v1/redirect/{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",
  "file": "www.example.com/*",
  "https": true,
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "status": "active",
  "forward_path": false,
  "forward_query": false,
  "created_at": "2023-11-15T15:09:14.000000Z",
  "updated_at": "2023-11-15T15:09:14.000000Z"
}

delete redirect

delete
授权
路径参数
idstring · string必填

redirect id

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

success

{
  "data": null
}
  • GETlist of redirects
  • POSTcreate redirect
  • GETGet details about a specific redirect by id
  • PUTupdate redirect
  • DELETEdelete redirect

list of redirects

get

Get all redirects

授权
响应
200
success
application/json
get
GET /v1/redirect 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",
      "file": "www.example.com/*",
      "https": true,
      "destination": "https://www.google.com",
      "destinations": "[]",
      "type": "301",
      "status": "active",
      "forward_path": false,
      "forward_query": false,
      "created_at": "2023-11-15T15:09:14.000000Z",
      "updated_at": "2023-11-15T15:09:14.000000Z"
    }
  ]
}

create redirect

post
授权
请求体
urlstring可选

URL

Example: www.example.com
destinationstring可选

Destination URL

Example: https://www.google.com
destinationsarray[string]可选

More Destinations

Example: []
typestring可选

Type

Example: 301
forward_pathboolean可选

whether forwarding slug to destination

Example: false
forward_queryboolean可选

whether forwarding query params to destination

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

{
  "url": "www.example.com",
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "forward_path": false,
  "forward_query": false
}
200

success

{
  "data": null
}

update redirect

put
授权
路径参数
idstring · string必填

redirect id

Example: 1639562002248499321
请求体
urlstring可选

URL

Example: www.example.com
destinationstring可选

Destination URL

Example: https://www.google.com
destinationsarray[string]可选

More Destinations

Example: []
typestring可选

Type

Example: 301
forward_pathboolean可选

whether forwarding slug to destination

Example: false
forward_queryboolean可选

whether forwarding query params to destination

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

{
  "url": "www.example.com",
  "destination": "https://www.google.com",
  "destinations": "[]",
  "type": "301",
  "forward_path": false,
  "forward_query": false
}
200

success

{
  "data": null
}