Page - 友好速搭 -- 使用手册

友好速搭

开放 API
使用说明 获取授权 全部 API 特殊 API 开放功能

Page

Page

#Page Page 是自定义页面,可以通过它的 API 动态创建自定义页面,并使用 Asset 定制个性化的页面模板。

Page 对象支持 Metafields

Page 相关API

GET /pages获取 Page 列表GET /pages/count获取Page数量GET /pages/#{id}获取单个PagePOST /pages创建 PagePUT /pages/#{id}更新 PageDELETE /pages/#{id}删除 PagePOST /pages/#{id}/upload_base64_share上传指定页面社交分享图片,id为对应页面的id。DELETE /pages/#{id}/remove_share删除指定页面的社交分享图片。

Page 属性

    • created_at
    •   { "created_at": "2014-09-01T00:00:01.987+08:00" }
      
      Datetime 类型,Page 的创建时间。
    • handle
    •   { "handle" : "my-first-handle" }
      
      Handle 类型,Page 的唯一字符串标识。
    • id
    •   { "id": 326 }
      
      Number 类型,Page 的唯一整型标识。
    • mobile_template
    •   { "mobile_template" : "page.html" }
      
      String 类型,Page 在移动端主题中使用的页面模板。
    • page_description
    • { "page_description" : "网页描述" }
      
      String 类型,Page 的网页描述,主要用于 SEO 优化。
    • page_title
    • { "page_title" : "网页标题" }
      
      Page 的网页标题,主要用于 SEO 优化。
    • page_keywords
    • { "page_keywords" : "网页关键词" }
      
      String 类型,Page 的网页关键词,主要用于 SEO 优化。
    • share_title
    •   { "share_title": "社交优化标题" }
      
      String 类型,社交优化标题
    • share_description
    •   { "share_description": "社交优化描述" }
      
      String 类型,社交优化描述
    • share_image_id
    •   { "share_image_id":  1024 }
      
      Integer 类型,社交图片id
    • template
    • { "template" : "page.html" }
      
      String 类型,Page 在通用主题中使用的页面模板。
    • title
    • { "title" : "欢迎使用友好速搭" }
      
      String 类型,Page 的标题。
    • updated_at
    •   { "updated_at": "2015-01-25T22:31:06.155+08:00" }
      
      Datetime 类型,Page 的最近一次修改时间。
    • visibility
    •   { "visibility" : true }
      
      Bool 类型,显示状态:true 显示,false 不显示。

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
    • {}
      
以上内容仍未解决您的问题? 联系在线客服
免费领取15天试用
立即注册
联系客服
微信咨询
微信二维码

领取免费试用资格

姓名 *

电话 *

公司名称

所在地区

意向产品

提交

提交成功

你好, XXX女士/先生 ,你的需求已提交成功,后续会有专门的客户经理与你电话联系。谢谢!