开放 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
Page
Page
Page 是自定义页面,可以通过它的 API 动态创建自定义页面,并使用 Asset 定制个性化的页面模板。
Page 对象支持 Metafields。
Page 相关API
Page 属性
- created_at
Datetime 类型,Page 的创建时间。{ "created_at": "2014-09-01T00:00:01.987+08:00" }
- handle
Handle 类型,Page 的唯一字符串标识。{ "handle" : "my-first-handle" }
- id
Number 类型,Page 的唯一整型标识。{ "id": 326 }
- mobile_template
String 类型,Page 在移动端主题中使用的页面模板。{ "mobile_template" : "page.html" }
- page_description
String 类型,Page 的网页描述,主要用于 SEO 优化。{ "page_description" : "网页描述" }
- page_title
Page 的网页标题,主要用于 SEO 优化。{ "page_title" : "网页标题" }
- page_keywords
String 类型,Page 的网页关键词,主要用于 SEO 优化。{ "page_keywords" : "网页关键词" }
- share_title
String 类型,社交优化标题{ "share_title": "社交优化标题" }
- share_description
String 类型,社交优化描述{ "share_description": "社交优化描述" }
- share_image_id
Integer 类型,社交图片id{ "share_image_id": 1024 }
- template
String 类型,Page 在通用主题中使用的页面模板。{ "template" : "page.html" }
- title
String 类型,Page 的标题。{ "title" : "欢迎使用友好速搭" }
- updated_at
Datetime 类型,Page 的最近一次修改时间。{ "updated_at": "2015-01-25T22:31:06.155+08:00" }
- visibility
Bool 类型,显示状态:true 显示,false 不显示。{ "visibility" : true }
GET /pages
获取 Page 列表
- limit
- 显示条数(默认10,最大50)
- page
- 显示页码(默认1)
- since_id
- 筛选
id
大于since_id
的Order
- fields
- 以
,
拼接Response显示的字段
- id
- 查询指定
id
- ids
- 以
,
拼接要显示的id
范围
- created_at_min
- 缺省筛选创建时间在指定日期时间之后的 Page(格式2014-09-01T01:00:01)
- created_at_max
- 缺省筛选创建时间在指定日期时间之前的 Page(格式2014-09-01T01:00:01)
- updated_at_min
- 缺省筛选更新时间在指定日期时间之后的 Page(格式2014-09-01T01:00:01)
- updated_at_max
- 缺省筛选更新时间在指定日期时间之前的 Page(格式2014-09-01T01:00:01)
- 获取Page列表
- GET /pages
{ "pages": [ { "created_at": "2014-08-28T17:28:13.467+08:00", "handle": "welcome", "id": 63, "mobile_template": "page.html", "page_description": "欢迎使用友好速搭", "page_title": "欢迎使用友好速搭", "share_description": "欢迎使用友好速搭", "share_title": "欢迎使用友好速搭", "template": "page.html", "title": "欢迎使用友好速搭", "updated_at": "2015-04-07T16:43:25.380+08:00", "visibility": true }, { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "share_description": "欢迎使用友好速搭", "share_title": "欢迎使用友好速搭", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } ] }
- 获取指定id范围的Page列表
- GET /pages?ids=63,3091
{ "pages": [ { "created_at": "2014-08-28T17:28:13.467+08:00", "handle": "welcome", "id": 63, "mobile_template": "page.html", "page_description": "欢迎使用友好速搭", "page_title": "欢迎使用友好速搭", "share_description": "欢迎使用友好速搭", "share_title": "欢迎使用友好速搭", "template": "page.html", "title": "欢迎使用友好速搭", "updated_at": "2015-04-07T16:43:25.380+08:00", "visibility": true }, { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "share_description": "欢迎使用友好速搭", "share_title": "欢迎使用友好速搭", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } ] }
- 获取 Page 列表,只显示部分字段
- GET /pages?fields=id,title
{ "pages": [ { "id": 63, "title": "欢迎使用友好速搭" }, { "id": 3091, "title": "联系我们" } ] }
- 获取指定
id
之后的Page列表 - GET /pages?since_id=63
{ "pages": [ { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "share_description": "", "share_title": "联系我们", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } ] }
- 获取指定
GET /pages/count
获取Page数量
- 获取Page数量
- GET /pages/count
{ "count": 2 }
GET /pages/#{id}
获取单个Page
- fields
- 以
,
拼接Response显示的字段
- 获取单个Page
- GET /pages/#{id}
{ "page": { "created_at": "2014-08-28T17:28:13.467+08:00", "handle": "welcome", "id": 63, "mobile_template": "page.html", "page_description": "欢迎使用友好速搭", "page_title": "欢迎使用友好速搭", "share_description": "欢迎使用友好速搭", "share_title": "欢迎使用友好速搭", "template": "page.html", "title": "欢迎使用友好速搭", "updated_at": "2015-04-07T16:43:25.380+08:00", "visibility": true } }
POST /pages
创建 Page
- 创建 Page
- POST /pages
{ "page": { "handle": "contact1", "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "share_description": "", "share_title": "联系我们", "template": "page.contact.html", "title": "联系我们", "visibility": true } }
{ "page": { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "share_description": "", "share_title": "联系我们", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } }
PUT /pages/#{id}
更新 Page
- 更新 Page 的标题
- PUT /pages/3091
{ "page": { "title": "联系我们" } }
{ "page": { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.html", "page_description": "", "page_title": "联系我们", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } }
- 更新 Page 的移动主题模板
- PUT /pages/3091
{ "page": { "mobile_template": "page.contact.html" } }
{ "page": { "created_at": "2015-04-11T04:32:29.033+08:00", "handle": "contact", "id": 3091, "mobile_template": "page.contact.html", "page_description": "", "page_title": "联系我们", "template": "page.contact.html", "title": "联系我们", "updated_at": "2015-04-11T04:33:27.123+08:00", "visibility": true } }
DELETE /pages/#{id}
删除 Page
- 删除 Page
- DELETE /pages/3091
{}
POST /pages/#{id}/upload_base64_share
上传指定页面社交分享图片,id为对应页面的id。
- file_name
- 上传图片的名称
- attachment
- 经过base64编码的图片
- 创建 share image
- POST /pages/4008/upload_base64_share
{ "share_image":{ "file_name":"s.jpg", "attachment":"data:image/gif;base64,R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs=" } }
{ "share_image": { "epoch": "1463994523", "height": 150, "id":788, "image_id":"57406f4080ea3e74b8000002", "src":"/image/57406f4080ea3e74b8000002/s.jpg?1463994523", "width": 228 } }
DELETE /pages/#{id}/remove_share
删除指定页面的社交分享图片。
- 删除ID为4008的页面的社交分享图片。
- DELETE /pages/4008/remove_share
{}