开源中国 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. 帖子

post_detail

POST
/action/openapi/post_detail
获取讨论区的帖子详情
是否需要登录
否
访问授权限制
暂无
授权范围(scope)
访问帖子信息
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.oschina.net/action/openapi/post_detail' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "string",
    "access_token": "string",
    "dataType": "string"
}'
响应示例响应示例
{
  "id": 121,
  "pubDate": "2009-02-24 23:47:54.0",
  "author": "红薯",
  "body": "04年1月写的一个在C语言中调用Java方法的小程序",
  "title": "04年1月写的一个在C语言中调用Java方法的小程序",
  "answerCount": 1,
  "authorid": 12,
  "viewCount": 441,
  "favorite": 1,
  "portrait": "http://static.oschina.net/uploads/user/0/12_50.jpg",
  "url": "http://liudong/question/12_121",
  "tags": [
    "C",
    "Java"
  ]
}

请求参数

Body 参数application/json
id
string 
帖子ID
必需
access_token
string 
必需
oauth2_token获取的access_token 传则显示是否收藏
dataType
string 
必需
返回数据类型['json'|'jsonp'|'xml']
示例

返回响应

🟢200成功
application/json
Body
id
integer 
帖子ID
必需
pubDate
string 
发布时间
必需
author
string 
发帖人
必需
body
string 
帖子内容
必需
title
string 
帖子标题
必需
answerCount
integer 
回复数
必需
authorid
integer 
发帖人ID
必需
viewCount
integer 
浏览数
必需
favorite
integer 
必需
是否收藏 1-收藏 0-未收藏
portrait
string 
发帖人用户头像地址
必需
url
string 
帖子链接
必需
tags
array[string]
相关标签
必需
修改于 2022-08-22 04:13:54
上一页
post_pub
下一页
tweet_list
Built with