开源中国 API
  1. 博客
开源中国 API
  • OSCHINA 开放平台Beta
  • 认证接口
    • oauth2_authorize
      GET
    • oauth2_token
      POST
  • 个人信息
    • openapi_user
      POST
    • user_information
      POST
    • my_information
      POST
    • portrait_update
      POST
    • friends_list
      POST
    • active_list
      POST
    • update_user_relation
      POST
  • 新闻
    • news_list
      POST
    • /action/openapi/news_detail
      POST
  • 帖子
    • post_list
      POST
    • post_pub
      POST
    • post_detail
      POST
  • 动弹
    • tweet_list
      POST
    • tweet_detail
      POST
    • tweet_pub
      POST
    • tweet_delete
      POST
  • 博客
    • blog_pub
      POST
    • blog_list
      POST
    • blog_recommend_list
      POST
    • blog_detail
      POST
    • user_blog_list
      POST
    • blog_catalog_list
      POST
  • 评论
    • blog_comment_list
    • blog_comment_pub
    • blog_comment_reply
    • user_blog_delete
    • comment_list
    • comment_pub
    • comment_reply
    • comment_delete
  • 收藏
    • favorite_list
    • favorite_add
    • favorite_remove
  • 软件
    • project_detail
    • project_catalog_list
    • project_list
    • project_tag_list
  • 私信
    • message_list
    • message_delete
  • 搜索
    • search_list
  • 通知
    • user_notice
    • clear_notice
  1. 博客

blog_pub

POST
/action/openapi/blog_pub
发布博客
是否需要登录
是
访问授权限制
password
授权范围(scope)
访问博客信息
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.oschina.net/action/openapi/blog_pub' \
--header 'Content-Type: application/json' \
--data-raw '{
    "access_token": "string",
    "title": "string",
    "content": "string",
    "save_as_draft": 0,
    "catalog": "string",
    "abstracts": "string",
    "tags": "string",
    "classification": 0,
    "type": 0,
    "origin_url": "string",
    "privacy": "string",
    "deny_comment": "string",
    "auto_content": "string",
    "as_top": "string"
}'
响应示例响应示例
200 - 成功 - 成功示例
{
  "error": 200,
  "error_description": "操作成功完成"
}

请求参数

Body 参数application/json
access_token
string 
必需
oauth2_token获取的access_token
title
string 
博客标题
必需
content
string 
博客内容
必需
save_as_draft
integer 
可选
保存到草稿 是:1 否:0
catalog
string 
博客分类
可选
abstracts
string 
博客摘要
可选
tags
string 
可选
博客标签,用逗号隔开
classification
integer 
系统博客分类
必需
type
integer 
原创:1、转载:4
可选
origin_url
string 
转载的原文链接
可选
privacy
string 
公开:0、私有:1
可选
deny_comment
string 
可选
允许评论:0、禁止评论:1
auto_content
string 
可选
自动生成目录:0、不自动生成目录:1
as_top
string 
可选
非置顶:0、置顶:1
示例

返回响应

🟢200成功
application/json
Body
error
integer 
必需
错误代码(200-操作成功,500-操作失败)
error_description
string 
错误描述
必需
🟢200异常
修改于 2022-08-22 04:14:49
上一页
tweet_delete
下一页
blog_list
Built with