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

友好速搭

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

Blog

Blog

#Blog

Blog 是博客对象,通过它可以读取博客内容,或者执行博客的创建、更新、删除。

友好速搭提供的是轻博客功能,Blog 分为:文字、音乐、图片、视频四种。目前,Blog 的开放 API,仅支持文字类型的博客。

Blog 对象支持 WebhookMetafields

Blog 相关API

GET /blogs获取 Blog 列表GET /blogs/count获取 Blog 数量GET /blogs/#{id}获取单个 BlogPOST /blogs创建 BlogPUT /blogs/#{id}更新 BlogDELETE /blogs/#{id}删除 BlogPOST /blogs/#{id}/upload_base64_share上传指定博客的社交分享图片,id为对应博客的id。DELETE /blogs/#{id}/remove_share删除指定博客的社交分享图片,id为博客id。

Blog 属性

    • id
    •   { "id": 326 }
      
      Number 类型,Blog 的唯一整型标识。
    • title
    • { "title" : "欢迎使用友好速搭" }
      
      String 类型,Blog 的标题。
    • content
    • { "content" : "博客内容" }
      
      String 类型,博客内容。
    • content_capture
    • { "content" : "博客内容摘要" }
      
      String 类型,博客内容摘要。
    • handle
    •   { "handle" : "my-first-handle" }
      
      Handle 类型,Blog 的自定义标识。
    • view_type
    • { "view_type" : 1 }
      
      Number 类型,Blog 的显示状态:0-全部可见;1-仅登录用户可见;2-仅管理员可见。
    • page_description
    • { "page_description" : "网页描述" }
      
      String 类型,Blog 的网页描述,主要用于 SEO 优化。
    • page_keywords
    • { "page_keywords" : "网页关键词" }
      
      String 类型,Blog 的网页关键词,主要用于 SEO 优化。
    • page_title
    • { "page_title" : "网页标题" }
      
      String 类型,Blog 的网页标题,主要用于 SEO 优化。
    • share_title
    •   { "share_title": "社交优化标题" }
      
      String 类型,社交优化标题。
    • share_description
    •   { "share_description": "社交优化描述" }
      
      String 类型,社交优化描述。
    • share_image_id
    •   { "share_image_id":  1024 }
      
      Integer 类型,社交图片id。
    • created_at
    • { "created_at": "2015-01-25T22:31:06.155+08:00" }
      
      Datetime 类型,Blog 的创建时间。
    • updated_at
    • { "updated_at": "2015-01-25T22:31:06.155+08:00" }
      
      Datetime 类型,Blog 的最近一次修改时间。
    • post_at
    • { "post_at": "2015-01-25T22:31:06.155+08:00" }
      
      Datetime 类型,Blog 的发布时间。
    • tags
    • { "tags": ["test"] }
      
      Array 类型,Blog 的标签。

GET /blogs

获取 Blog 列表

    • tag
    • 模糊查询指定标签
    • limit
    • 显示条数(默认10,最大50)
    • page
    • 显示页码(默认1)
    • since_id
    • 筛选id大于since_id的 Blog
    • fields
    • ,拼接需要获取的字段
    • id
    • 查询指定id
    • ids
    • ,拼接要显示的id范围
    • created_at_min
    • 缺省筛选创建时间在指定日期时间之后的 Blog(格式2014-09-01T01:00:01)
    • created_at_max
    • 缺省筛选创建时间在指定日期时间之前的 Blog(格式2014-09-01T01:00:01)
    • updated_at_min
    • 缺省筛选更新时间在指定日期时间之后的 Blog(格式2014-09-01T01:00:01)
    • updated_at_max
    • 缺省筛选更新时间在指定日期时间之前的 Blog(格式2014-09-01T01:00:01)
    • 获取 Blog 列表
    • GET /blogs
    • {
      "blogs": [
          {
              "blog_author": {
                  "avatar": {
                      "id": 249,
                      "asset_id": "54fc12b54812f22a6800000b",
                      "file_name": "QQ截图20140327131522.png",
                      "epoch": "1425806020",
                      "src": "/image/54fc12b54812f22a6800000b/QQ截图20140327131522.png?1425806020"
                  },
                  "created_at": "2015-03-08T17:13:40.943+08:00",
                  "douban_url": "",
                  "id": 119,
                  "name": "LavandaChen",
                  "renren_url": "",
                  "updated_at": "2015-03-08T17:13:40.943+08:00",
                  "weibo_url": "",
                  "weixin_name": "",
                  "weixin_qc_code": null
              },
              "content": "非常好看,而且看多少个版本都会觉得好。因为:<br /><br />1、本土化之后比国外的版本更好一些,因为感同身受的感觉更强烈;<br />2、这种类型的案件发生时间越靠近观众所处的时间观众理解就会越深,所反映的社会问题也就越会被观众所理解。<br />所以从这两个意义上这类电影或戏剧是常做常新的。",
              "content_capture": "非常好看,而且看多少个版本都会觉得好。因为:1、本土化之后比国外的版本更好一些,因为感同身受的感觉更强烈;2、这种类型的案件发生时间越靠近观众所处的时间观众理解就会越深,所反映的社会问题也就越会被观众所理解。所以从这两个意义上这类电影或戏剧是常做常新的。",
              "created_at": "2015-10-07T13:19:36.680+08:00",
              "handle": "b000010",
              "id": 1915,
              "page_description": "",
              "page_keywords": "",
              "share_description": "",
              "share_title": "",
              "page_title": "十二怒汉",
              "post_at": "2015-10-07T13:20:56.134+08:00",
              "tags": [
                  "电影"
              ],
              "title": "十二怒汉",
              "updated_at": "2016-01-07T01:48:21.873+08:00",
              "view_type": 0
          }
      }
      

GET /blogs/count

获取 Blog 数量

    • 获取 Blog 数量
    • GET /blogs/count
    • {
      "count": 2
      }
      

GET /blogs/#{id}

获取单个 Blog

    • fields
    • ,拼接要指定返回的字段
    • 获取单个 Blog
    • GET /blogs/#{id}
    • {
      "blog": {
          "blog_author": {
              "avatar": {
                  "id": 249,
                  "asset_id": "54fc12b54812f22a6800000b",
                  "file_name": "QQ截图20140327131522.png",
                  "epoch": "1425806020",
                  "src": "/image/54fc12b54812f22a6800000b/QQ截图20140327131522.png?1425806020"
              },
              "created_at": "2015-03-08T17:13:40.943+08:00",
              "douban_url": "",
              "id": 119,
              "name": "LavandaChen",
              "renren_url": "",
              "updated_at": "2015-03-08T17:13:40.943+08:00",
              "weibo_url": "",
              "weixin_name": "",
              "weixin_qc_code": null
          },
          "content": "test11",
          "content_capture": "test11",
          "created_at": "2015-12-17T20:36:49.366+08:00",
          "handle": "b000014",
          "id": 2641,
          "page_description": "",
          "page_keywords": "",
          "page_title": "test",
          "share_description": "",
          "share_title": "",
          "post_at": "2015-12-17T20:37:00.223+08:00",
          "tags": [
              "test"
          ],
          "title": "test",
          "updated_at": "2016-01-06T23:21:28.120+08:00",
          "view_type": 2
      }
      }
      

POST /blogs

创建 Blog

    • 创建 Blog
    • POST /blogs
      {
      "blog": {
          "blog_author": {
              "id": 119
          },
          "content": "<p>test&nbsp;</p>",
          "content_capture": "test11",
          "page_description": "",
          "page_keywords": "",
          "page_title": "",
          "share_description": "",
          "share_title": "",
          "post_at": "2014-11-25T20:09:00.438+08:00",
          "title": "1112",
          "view_type": 2,
          "tags":["test1","1","2","1"]
      }
      }
      
    • {
      "blog": {
          "blog_author": {
              "avatar": {
                  "id": 249,
                  "asset_id": "54fc12b54812f22a6800000b",
                  "file_name": "QQ截图20140327131522.png",
                  "epoch": "1425806020",
                  "src": "/image/54fc12b54812f22a6800000b/QQ截图20140327131522.png?1425806020"
              },
              "created_at": "2015-03-08T17:13:40.943+08:00",
              "douban_url": "",
              "id": 119,
              "name": "LavandaChen",
              "renren_url": "",
              "updated_at": "2015-03-08T17:13:40.943+08:00",
              "weibo_url": "",
              "weixin_name": "",
              "weixin_qc_code": null
          },
          "content": "<p>test&nbsp;</p>",
          "content_capture": "test11",
          "created_at": "2016-01-07T02:27:00.315+08:00",
          "handle": "b000021",
          "id": 3009,
          "page_description": "",
          "page_keywords": "",
          "share_description": "",
          "share_title": "",
          "page_title": "",
          "post_at": "2014-11-25T20:09:00.438+08:00",
          "tags": [
              "1",
              "2",
              "test1"
          ],
          "title": "1112",
          "updated_at": "2016-01-07T02:27:00.315+08:00",
          "view_type": 0
      }
      }
      

PUT /blogs/#{id}

更新 Blog

    • 更新 Blog
    • PUT /blogs/3009
      {
      "blog": {
          "title": "新标题",
           "content": "<p>test&nbsp;</p>"
      }
      }
      
    • {
      "blog": {
          "blog_author": {
              "avatar": {
                  "id": 249,
                  "asset_id": "54fc12b54812f22a6800000b",
                  "file_name": "QQ截图20140327131522.png",
                  "epoch": "1425806020",
                  "src": "/image/54fc12b54812f22a6800000b/QQ截图20140327131522.png?1425806020"
              },
              "created_at": "2015-03-08T17:13:40.943+08:00",
              "douban_url": "",
              "id": 119,
              "name": "LavandaChen",
              "renren_url": "",
              "updated_at": "2015-03-08T17:13:40.943+08:00",
              "weibo_url": "",
              "weixin_name": "",
              "weixin_qc_code": null
          },
          "content": "<p>test&nbsp;</p>",
          "content_capture": "test11",
          "created_at": "2016-01-07T02:27:00.315+08:00",
          "handle": "b000021",
          "id": 3009,
          "page_description": "",
          "page_keywords": "",
          "share_description": "",
          "share_title": "",
          "page_title": "",
          "post_at": "2014-11-25T20:09:00.438+08:00",
          "tags": [
              "1",
              "2",
              "test1"
          ],
          "title": "新标题",
          "updated_at": "2016-01-07T02:27:00.315+08:00",
          "view_type": 0
      }
      }
      

DELETE /blogs/#{id}

删除 Blog

    • 删除 Blog
    • DELETE /blogs/3009
    • {}
      

POST /blogs/#{id}/upload_base64_share

上传指定博客的社交分享图片,id为对应博客的id。

    • file_name
    • 上传图片的名称
    • attachment
    • 经过base64编码的图片
    • 创建 share image
    • POST /blogs/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 /blogs/#{id}/remove_share

删除指定博客的社交分享图片,id为博客id。

    • 删除ID为4008的博客的社交分享图片。
    • DELETE /blogs/4008/remove_share
    • {}
      
以上内容仍未解决您的问题? 联系在线客服
免费领取15天试用
立即注册
联系客服
微信咨询
微信二维码

领取免费试用资格

姓名 *

电话 *

公司名称

所在地区

意向产品

提交

提交成功

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