开放 API
使用说明
获取授权
全部 API
- Shop
- Metafields
- Customer
- CustomerAddress
- Account
- Product
- ProductVariant
- ProductImage
- Theme
- Asset
- Country
- Province
- City
- District
- ScriptTag
- Order
- Shipment
- ShipmentSupplier
- Payment
- PaymentMethod
- Redirect
- Page
- Webhook
- Blog
- BlogAuthor
- CustomerLevel
- StoreFile
- Promotion
- Coupon
- Post
- AfterSale
Redirect
Redirect
Redirect 是店铺中设置的 URL 重定向。
Redirect 相关API
Redirect 相关属性
- id
Number 类型,Redirect 的唯一整型标识。{ "id" : 148002 }
- path
String 类型,Redirect 的访问网址。{ "path" : '/'}
- target
String 类型,Redirect 的重定向目标网址。{ "target" : "/blogs" }
- created_at
Datetime 类型,Redirect 的创建时间。{ "created_at" : "2014-02-15T15:12:21+08:00" }
- updated_at
Datetime 类型,Redirect 的上一次更新时间。{ "updated_at" : "2014-02-15T15:12:21+08:00" }
GET /redirects
获取所有 Redirect
- fields
- 需要查询的字段
- 获取所有 Redirect
- GET /redirects
{ "redirects": [ { "created_at": "2015-05-12T22:15:38.130+08:00", "id": 19860, "path": "/123456", "target": "/blogs", "updated_at": "2015-05-13T10:20:59.645+08:00" }, { "created_at": "2015-05-12T22:15:49.661+08:00", "id": 19861, "path": "/123", "target": "/products", "updated_at": "2015-05-12T22:15:49.661+08:00" }, { "created_at": "2015-05-13T10:21:23.185+08:00", "id": 19862, "path": "/1", "target": "/blogs", "updated_at": "2015-05-13T10:21:23.185+08:00" } ] }
GET /redirects/count
获取所有 Redirect 的数量
- 获取所有 Redirect 的数量
- GET /redirects/count
{ "count": 3 }
GET /redirects/#{id}
获取单个 Redirect
- fields
- 需要查询的字段
- 获取单个Redirect
- GET /redirects/19860
{ "redirect": { "created_at": "2015-05-12T22:15:38.130+08:00", "id": 19860, "path": "/123456", "target": "/blogs", "updated_at": "2015-05-13T10:20:59.645+08:00" } }
POST /redirects
创建 Redirect
- redirect[path]
- Redirect的访问网址
- redirect[target]
- Redirect的重定向目标网址
- 创建 Redirect
- POST /redirects
{ "redirect": { "path": "/12", "target": "/blogs" } }
{ "redirect": { "created_at": "2015-05-13T10:27:18.762+08:00", "id": 19864, "path": "/12", "target": "/blogs", "updated_at": "2015-05-13T10:27:18.762+08:00" } }
PUT /redirects/#{id}
更新 Redirect
- redirect[path]
- Redirect的访问网址
- redirect[target]
- Redirect的重定向目标网址
- 更新 Redirect
- PUT /redirects/19860
{ "redirect": { "path": "/12345", "target": "/blogs" } }
{ "redirect": { "created_at": "2015-05-12T22:15:38.130+08:00", "id": 19860, "path": "/12345", "target": "/blogs", "updated_at": "2015-05-13T10:29:59.573+08:00" } }
DELETE /redirects/#{id}
删除 Redirect
- 删除 Redirect
- DELETE /redirects/19860
{}