---
title: "获取重定向列表"
description: "查询重定向列表"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/redirect/get-a-list-of-redirect'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/redirect/get-a-list-of-redirect.md'
---
# 获取重定向列表

查询重定向列表

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_content`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /redirects/redirect.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_content`

## Request

### Query Parameters

* `limit`

  integer (optional)

  指定返回的结果数量，默认值为50

* `path`

  string (optional)

  重定向的源路径

* `since_id`

  string (optional)

  指定具体重定向id，返回该id后的所有重定向结果，非必填

* `target`

  string (optional)

  重定向的目标路径

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `redirects`

  array<object>

  重定向信息

  * `id`

    string

    重定向的id

  * `path`

    string

    重定向的源路径

  * `target`

    string

    重定向的目标路径

  * `updated_at`

    string

    重定向的更新时间

  * `create_at`

    string

    重定向的创建时间


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "查询重定向列表",
  "externalDocs": {
    "description": "接口使用的权限点: `write_content` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "MjGMUW0A",
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "description": "指定返回的结果数量，默认值为50",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "limit",
        "description": "指定返回的结果数量，默认值为50",
        "type": "integer",
        "example": 50
      },
      "example": 50
    },
    {
      "name": "path",
      "in": "query",
      "description": "重定向的源路径",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "path",
        "description": "重定向的源路径",
        "type": "string",
        "example": "/products/A"
      },
      "example": "/products/A",
      "examples": {
        "查询重定向列表-指定path": {
          "value": "/products/A"
        }
      }
    },
    {
      "name": "since_id",
      "in": "query",
      "description": "指定具体重定向id，返回该id后的所有重定向结果，非必填",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "since_id",
        "description": "指定具体重定向id，返回该id后的所有重定向结果，非必填",
        "type": "string",
        "example": "62f372efcb98825e786f4196"
      },
      "example": "62f372efcb98825e786f4196",
      "examples": {
        "查询重定向列表-使用since_id实现翻页功能": {
          "value": "63a94fc5609552261f008296"
        }
      }
    },
    {
      "name": "target",
      "in": "query",
      "description": "重定向的目标路径",
      "style": "form",
      "explode": true,
      "schema": {
        "name": "target",
        "description": "重定向的目标路径",
        "type": "string",
        "example": "/products/B"
      },
      "example": "/products/B"
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "redirects": {
                "name": "redirects",
                "description": "重定向信息",
                "type": "array",
                "items": {
                  "name": "redirects",
                  "description": "重定向信息",
                  "type": "object",
                  "properties": {
                    "id": {
                      "name": "id",
                      "description": "重定向的id",
                      "type": "string",
                      "example": "62f372efcb98825e786f4196"
                    },
                    "path": {
                      "name": "path",
                      "description": "重定向的源路径",
                      "type": "string",
                      "example": "/products/A"
                    },
                    "target": {
                      "name": "target",
                      "description": "重定向的目标路径",
                      "type": "string",
                      "example": "/products/B"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "重定向的更新时间",
                      "type": "string",
                      "example": "2021-08-31T02:20:26+08:00"
                    },
                    "create_at": {
                      "name": "create_at",
                      "description": "重定向的创建时间",
                      "type": "string",
                      "example": "2021-08-31T02:20:26+08:00"
                    }
                  },
                  "example": {
                    "updated_at": "2021-08-31T02:20:26+08:00",
                    "create_at": "2021-08-31T02:20:26+08:00",
                    "id": "62f372efcb98825e786f4196",
                    "path": "/products/A",
                    "target": "/products/B"
                  }
                },
                "example": [
                  {
                    "target": "/products/B",
                    "updated_at": "2021-08-31T02:20:26+08:00",
                    "create_at": "2021-08-31T02:20:26+08:00",
                    "id": "62f372efcb98825e786f4196",
                    "path": "/products/A"
                  }
                ]
              }
            },
            "example": {
              "redirects": [
                {
                  "id": "62f372efcb98825e786f4196",
                  "path": "/products/A",
                  "target": "/products/B",
                  "updated_at": "2021-08-31T02:20:26+08:00",
                  "create_at": "2021-08-31T02:20:26+08:00"
                }
              ]
            }
          },
          "examples": {
            "查询重定向列表-使用since_id实现翻页功能": {
              "value": {
                "redirects": [
                  {
                    "create_at": "2022-12-26T15:59:47+08:00",
                    "id": "63a95473609552261f00942c",
                    "path": "/products/A",
                    "target": "/products/B",
                    "updated_at": "2022-12-26T16:22:33+08:00"
                  }
                ]
              }
            },
            "查询重定向列表-指定path": {
              "value": {
                "redirects": [
                  {
                    "updated_at": "2022-12-26T16:22:33+08:00",
                    "create_at": "2022-12-26T15:59:47+08:00",
                    "id": "63a95473609552261f00942c",
                    "path": "/products/A",
                    "target": "/products/B"
                  }
                ]
              }
            },
            "获取重定向列表": {
              "value": {
                "redirects": [
                  {
                    "create_at": "2023-09-22T15:27:06+08:00",
                    "id": "650d41ca6efcc96ac04fc1b6",
                    "path": "/products/A",
                    "target": "/products/B",
                    "updated_at": "2023-09-22T15:27:06+08:00"
                  },
                  {
                    "id": "650d4ffa1aa1492e59271622",
                    "path": "/products/C",
                    "target": "/products/D",
                    "updated_at": "2023-09-22T16:27:38+08:00",
                    "create_at": "2023-09-22T16:27:38+08:00"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/redirects/redirect.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "获取重定向列表",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_content"
  ]
}
```