开源中国 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. 新闻

/action/openapi/news_detail

POST
/action/openapi/news_detail
获取新闻详情
是否需要登录
否
访问授权限制
暂无
授权范围(scope)
访问新闻资讯
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.oschina.net/action/openapi/news_detail' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "string",
    "access_token": "string",
    "dataType": "string"
}'
响应示例响应示例
{
    "id": 11,
    "body": "语法高亮文本编辑器",
    "pubDate": "2008-09-15 17:00:29.0",
    "author": "总管",
    "title": "VirtualBox 2.0.2 released!",
    "authorid": 1,
    "relativies": [
        {
            "title": "RSyntaxTextArea 2.0.2 发布 语法高亮文本编辑器",
            "url": "http://liudong/news/26709/rsyntaxtextarea-2-0-2"
        },
        {
            "title": "Bootstrap 2.0.2 发布,Web 前端工具包",
            "url": "http://liudong/news/26688/bootstrap-2-0-2"
        },
        {
            "title": "Airtime 2.0.2 发布 - 电台管理系统",
            "url": "http://liudong/news/26516/airtime-202"
        },
        {
            "title": "Wayland and Weston 0.85.0 released",
            "url": "http://liudong/news/25610"
        },
        {
            "title": "jOOQ 2.0.2 发布,Java的ORM框架",
            "url": "http://liudong/news/24645/jooq-2-0-2-released"
        },
        {
            "title": "RemoteBox 1.2 发布,VirtualBox 管理工具",
            "url": "http://liudong/news/24463/remotebox-1-2-released"
        },
        {
            "title": "ChromePlus 2.0.0.4 Released(for Windows)",
            "url": "http://liudong/news/24457/chromeplus-2-0-0-4-for-windows"
        },
        {
            "title": "VirtualBox 4.1.8.75467 Final",
            "url": "http://liudong/news/24172/virtualbox-4-1-8-released"
        },
        {
            "title": "Spring Roo 1.2.0.RELEASED 发布",
            "url": "http://liudong/news/24114/spring-roo-1-2-0-released"
        },
        {
            "title": "MongoDB 2.0.2 发布",
            "url": "http://liudong/news/24076"
        }
    ],
    "notice": {
        "replyCount": 0,
        "msgCount": 0,
        "fansCount": 0,
        "referCount": 0
    },
    "favorite": 0,
    "commentCount": 0,
    "url": "http://liudong/news/11"
}

请求参数

Body 参数application/json
id
string 
新闻编号
必需
access_token
string 
可选
oauth2_token获取的access_token 传则显示是否收藏 用户未登录则不传
dataType
string 
可选
返回数据类型 ['json'|'jsonp'|'xml']
示例

返回响应

🟢200成功
application/json
Body
id
integer 
新闻编号
必需
body
string 
必需
新闻内容(HTML)
pubDate
string 
发布日期
必需
author
string 
投递者编号
必需
title
string 
新闻标题
必需
authorid
integer 
必需
relativies
array [object {2}] 
必需
title
string 
新闻标题
必需
url
string 
新闻原链接
必需
notice
object 
必需
replyCount
integer 
未读评论数
必需
msgCount
integer 
未读私信数
必需
fansCount
integer 
新增粉丝数
必需
referCount
integer 
未读@我数
必需
favorite
integer 
必需
是否收藏 1-收藏 0-未收藏
commentCount
integer 
评论数
必需
url
string 
新闻原地址
必需
修改于 2022-08-22 05:42:54
上一页
news_list
下一页
post_list
Built with