• 想在手表上愉快的浏览本站?不妨安装手表专属客户端!
    传送门:手表客户端,已适配圆屏!
    2.1.2版本手表客户端已重发布,修复了页面栈错乱和圆屏资源主页异常的问题

ForumCopilot Api文档

ForumCopilot API

接口文档 v1.3.7  ·  XenForo 2.3.6

接口地址
https://your-site.com/forumcopilot.php

请求方式
POST application/json

请求格式
{"method": "xxx", "params": {...}}

返回格式
{"result": true, "data": {...}}{"result": false, "error": "..."}

目录

1. 配置接口 (Config)

方法描述参数示例
getConfig获取论坛配置
{"method": "getConfig", "params": {}}

2. 账户接口 (Account)

方法描述参数示例
login用户登录loginname, password
{"method": "login", "params": {"loginname":"user","password":"pass"}}
logout用户登出
{"method": "logout", "params": {}}
register用户注册username, email, password, passwordConfirm
{"method": "register", "params": {"username":"new","email":"a@b.com","password":"123","passwordConfirm":"123"}}
prefetchAccount预获取账户信息userId
{"method": "prefetchAccount", "params": {"userId":123}}
forgotPassword忘记密码email
{"method": "forgotPassword", "params": {"email":"a@b.com"}}
updatePassword修改密码oldPassword, newPassword
{"method": "updatePassword", "params": {"oldPassword":"old","newPassword":"new"}}
updateEmail修改邮箱password, email
{"method": "updateEmail", "params": {"password":"123","email":"new@b.com"}}
updateProfile更新资料customFields?, avatar?
{"method": "updateProfile", "params": {"customFields":{}}}
getUserSettings获取设置
{"method": "getUserSettings", "params": {}}
updateUserSettings更新设置settings (object)
{"method": "updateUserSettings", "params": {"settings":{}}}
getUserSettingsCategories获取设置分类
{"method": "getUserSettingsCategories", "params": {}}
getPasskeyChallenge获取 Passkey 挑战
{"method": "getPasskeyChallenge", "params": {}}
getHelpPage帮助页面pageId?
{"method": "getHelpPage", "params": {}}

3. 用户接口 (User)

方法描述参数示例
getUserInfo获取用户信息userId (必填)
{"method": "getUserInfo", "params": {"userId":123}}
searchUser搜索用户keyword, page?, limit?
{"method": "searchUser", "params": {"keyword":"name","page":1}}
getInboxStat收件箱统计
{"method": "getInboxStat", "params": {}}
getOnlineUsers在线用户limit?
{"method": "getOnlineUsers", "params": {"limit":20}}
getUserReplyPost用户回复帖子userId, page?
{"method": "getUserReplyPost", "params": {"userId":123}}
reportUser举报用户userId, message
{"method": "reportUser", "params": {"userId":123,"message":"reason"}}
updateOnlineStatus更新在线状态activity?, title?
{"method": "updateOnlineStatus", "params": {"activity":"watch"}}
getSessionActivitySchema获取活动架构
{"method": "getSessionActivitySchema", "params": {}}

4. 个人空间 (UserSpace)

方法描述参数示例
getUserSpaceActivity用户空间动态userId, page?
{"method": "getUserSpaceActivity", "params": {"userId":123}}
getUserSpaceProfilePosts用户空间帖子userId, page?
{"method": "getUserSpaceProfilePosts", "params": {"userId":123}}
getFollowingFeed关注动态page?
{"method": "getFollowingFeed", "params": {"page":1}}
getGlobalFeed全局动态page?
{"method": "getGlobalFeed", "params": {"page":1}}
getProfilePostComments获取动态评论profilePostId, page?
{"method": "getProfilePostComments", "params": {"profilePostId":456}}
postProfilePostComment发布评论profilePostId, message
{"method": "postProfilePostComment", "params": {"profilePostId":456,"message":"内容"}}
postProfilePost发布动态message, attachments?
{"method": "postProfilePost", "params": {"message":"内容"}}
deleteProfilePost删除动态profilePostId
{"method": "deleteProfilePost", "params": {"profilePostId":456}}
likeProfilePost点赞动态profilePostId
{"method": "likeProfilePost", "params": {"profilePostId":456}}
unlikeProfilePost取消点赞profilePostId
{"method": "unlikeProfilePost", "params": {"profilePostId":456}}
followUser关注用户userId
{"method": "followUser", "params": {"userId":123}}
unfollowUser取消关注userId
{"method": "unfollowUser", "params": {"userId":123}}
getFollowing关注列表userId, page?
{"method": "getFollowing", "params": {"userId":123}}
getFollowers粉丝列表userId, page?
{"method": "getFollowers", "params": {"userId":123}}
fixCommentCounts修复评论数
{"method": "fixCommentCounts", "params": {}}
checkCommentCounts检查评论数
{"method": "checkCommentCounts", "params": {}}

5. 版块接口 (Forum)

方法描述参数示例
getForum获取版块forumId (必填)
{"method": "getForum", "params": {"forumId":1}}
markAllAsRead标记已读forumId?
{"method": "markAllAsRead", "params": {"forumId":1}}
getForumStatus版块状态
{"method": "getForumStatus", "params": {}}
getBoardStat论坛统计
{"method": "getBoardStat", "params": {}}
getParticipatedForum参与的版块page?
{"method": "getParticipatedForum", "params": {"page":1}}
loginForum版块登录forumId
{"method": "loginForum", "params": {"forumId":1}}

6. 主题接口 (Topic)

方法描述参数示例
getTopic获取主题topicId (必填)
{"method": "getTopic", "params": {"topicId":123}}
getTopTopic置顶主题forumId?, limit?
{"method": "getTopTopic", "params": {"forumId":1}}
getAnnTopic公告主题forumId?
{"method": "getAnnTopic", "params": {"forumId":1}}
getLatestTopic最新主题forumId?, page?, limit?
{"method": "getLatestTopic", "params": {"page":1}}
getUnreadTopic未读主题page?
{"method": "getUnreadTopic", "params": {"page":1}}
getParticipatedTopic参与主题userId, page?
{"method": "getParticipatedTopic", "params": {"userId":123}}
getTopicByIds批量主题topicIds (array)
{"method": "getTopicByIds", "params": {"topicIds":[1,2,3]}}
newTopic发布主题forumId, title, content
{"method": "newTopic", "params": {"forumId":1,"title":"标题","content":"内容"}}
markTopicRead标记已读topicId, postId?
{"method": "markTopicRead", "params": {"topicId":123}}

7. 帖子接口 (Post)

方法描述参数示例
getThread帖子详情topicId, page?, limit?
{"method": "getThread", "params": {"topicId":123,"page":1}}
getThreadByPost通过帖子获取主题postId
{"method": "getThreadByPost", "params": {"postId":456}}
getThreadByUnread通过未读获取主题topicId
{"method": "getThreadByUnread", "params": {"topicId":123}}
votePoll投票topicId, pollOptionId
{"method": "votePoll", "params": {"topicId":123,"pollOptionId":1}}
replyPost回复帖子topicId, content, quoteId?
{"method": "replyPost", "params": {"topicId":123,"content":"回复"}}
getRawPost原始帖子postId
{"method": "getRawPost", "params": {"postId":456}}
saveRawPost保存编辑postId, content
{"method": "saveRawPost", "params": {"postId":456,"content":"新内容"}}
getQuotePost引用帖子postId
{"method": "getQuotePost", "params": {"postId":456}}
reportPost举报帖子postId, message
{"method": "reportPost", "params": {"postId":456,"message":"原因"}}
方法描述参数示例
searchTopic搜索主题keyword, forumId?, page?
{"method": "searchTopic", "params": {"keyword":"关键词"}}
searchPost搜索帖子keyword, page?
{"method": "searchPost", "params": {"keyword":"关键词"}}
advanceSearchTopic高级搜索主题keywords?, forumId?, author?
{"method": "advanceSearchTopic", "params": {"keywords":"词"}}
advanceSearchPost高级搜索帖子keywords?, author?
{"method": "advanceSearchPost", "params": {"keywords":"词"}}

9. 附件接口 (Attachment)

方法描述参数示例
uploadAttachment上传附件file, filename, mimeType
{"method": "uploadAttachment", "params": {"filename":"a.jpg"}}
removeAttachment删除附件attachmentId
{"method": "removeAttachment", "params": {"attachmentId":123}}
uploadAvatar上传头像avatar (Base64)
{"method": "uploadAvatar", "params": {"avatar":"base64..."}}

10. 社交接口 (Social)

方法描述参数示例
likePost点赞帖子postId
{"method": "likePost", "params": {"postId":456}}
unlikePost取消点赞postId
{"method": "unlikePost", "params": {"postId":456}}
follow关注userId
{"method": "follow", "params": {"userId":123}}
unfollow取消关注userId
{"method": "unfollow", "params": {"userId":123}}
getAlert获取提醒page?, limit?
{"method": "getAlert", "params": {"page":1}}
getAlertCount提醒数量
{"method": "getAlertCount", "params": {}}
thankPost感谢帖子postId
{"method": "thankPost", "params": {"postId":456}}

11. 书签接口 (Bookmark)

方法描述参数示例
bookmarkThread收藏主题topicId
{"method": "bookmarkThread", "params": {"topicId":123}}
unbookmarkThread取消收藏topicId
{"method": "unbookmarkThread", "params": {"topicId":123}}
bookmarkResource收藏资源resourceId
{"method": "bookmarkResource", "params": {"resourceId":456}}
unbookmarkResource取消收藏资源resourceId
{"method": "unbookmarkResource", "params": {"resourceId":456}}
getBookmarks获取收藏page?, limit?, type?
{"method": "getBookmarks", "params": {"page":1}}

12. 订阅接口 (Subscription)

方法描述参数示例
getSubscribedForum订阅版块page?
{"method": "getSubscribedForum", "params": {"page":1}}
subscribeForum订阅版块forumId
{"method": "subscribeForum", "params": {"forumId":1}}
unsubscribeForum取消订阅forumId
{"method": "unsubscribeForum", "params": {"forumId":1}}
getSubscribedTopic订阅主题page?
{"method": "getSubscribedTopic", "params": {"page":1}}
subscribeTopic订阅主题topicId
{"method": "subscribeTopic", "params": {"topicId":123}}
unsubscribeTopic取消订阅topicId
{"method": "unsubscribeTopic", "params": {"topicId":123}}

13. moderation 接口 (Moderation)

方法描述参数示例
doLoginMod版主登录username, password
{"method": "doLoginMod", "params": {"username":"mod"}}
stickTopic置顶主题topicId
{"method": "stickTopic", "params": {"topicId":123}}
unstickTopic取消置顶topicId
{"method": "unstickTopic", "params": {"topicId":123}}
closeTopic关闭主题topicId
{"method": "closeTopic", "params": {"topicId":123}}
uncloseTopic开启主题topicId
{"method": "uncloseTopic", "params": {"topicId":123}}
deleteTopic删除主题topicId
{"method": "deleteTopic", "params": {"topicId":123}}
deletePost删除帖子postId
{"method": "deletePost", "params": {"postId":456}}
undeleteTopic恢复主题topicId
{"method": "undeleteTopic", "params": {"topicId":123}}
undeletePost恢复帖子postId
{"method": "undeletePost", "params": {"postId":456}}
moveTopic移动主题topicId, forumId
{"method": "moveTopic", "params": {"topicId":123,"forumId":2}}
renameTopic重命名topicId, title
{"method": "renameTopic", "params": {"topicId":123,"title":"新标题"}}
approveTopic审核主题topicId
{"method": "approveTopic", "params": {"topicId":123}}
approvePost审核帖子postId
{"method": "approvePost", "params": {"postId":456}}
banUser封禁用户userId, reason?
{"method": "banUser", "params": {"userId":123}}
unbanUser解封用户userId
{"method": "unbanUser", "params": {"userId":123}}
spamCleanUser清理垃圾用户userId
{"method": "spamCleanUser", "params": {"userId":123}}

14. 私信接口 (Private Conversation)

方法描述参数示例
newConversation创建会话recipientIds, title, message
{"method": "newConversation", "params": {"recipientIds":[123],"title":"标题"}}
replyConversation回复会话conversationId, message
{"method": "replyConversation", "params": {"conversationId":789,"message":"回复"}}
getConversations会话列表page?, limit?
{"method": "getConversations", "params": {"page":1}}
getConversation会话详情conversationId, page?
{"method": "getConversation", "params": {"conversationId":789}}
getConversationByMessage通过消息获取会话messageId
{"method": "getConversationByMessage", "params": {"messageId":111}}
getRawConversation原始会话conversationId
{"method": "getRawConversation", "params": {"conversationId":789}}
saveRawConversation保存编辑会话conversationId, title, message
{"method": "saveRawConversation", "params": {"conversationId":789}}
getRawMessage原始消息messageId
{"method": "getRawMessage", "params": {"messageId":111}}
saveRawMessage保存编辑消息messageId, message
{"method": "saveRawMessage", "params": {"messageId":111,"message":"内容"}}
closeConversation关闭会话conversationId
{"method": "closeConversation", "params": {"conversationId":789}}
uncloseConversation开启会话conversationId
{"method": "uncloseConversation", "params": {"conversationId":789}}
markConversationRead标记已读conversationId
{"method": "markConversationRead", "params": {"conversationId":789}}
markConversationUnread标记未读conversationId
{"method": "markConversationUnread", "params": {"conversationId":789}}
leaveConversation离开会话conversationId
{"method": "leaveConversation", "params": {"conversationId":789}}
inviteParticipant邀请参与conversationId, userId
{"method": "inviteParticipant", "params": {"conversationId":789,"userId":123}}
getQuoteConversation引用会话conversationId
{"method": "getQuoteConversation", "params": {"conversationId":789}}
likeConversationMessage点赞消息messageId
{"method": "likeConversationMessage", "params": {"messageId":111}}
unlikeConversationMessage取消点赞消息messageId
{"method": "unlikeConversationMessage", "params": {"messageId":111}}

15. 资源接口 (Resource)

方法描述参数示例
getResourceList资源列表categoryId?, page?, limit?
{"method": "getResourceList", "params": {"categoryId":1}}
getResourceCategories资源分类
{"method": "getResourceCategories", "params": {}}
getResourceDetail资源详情resourceId
{"method": "getResourceDetail", "params": {"resourceId":456}}
downloadResource下载资源resourceId, versionId?
{"method": "downloadResource", "params": {"resourceId":456}}
searchResource搜索资源keyword, categoryId?, page?
{"method": "searchResource", "params": {"keyword":"关键词"}}
getUserResources用户资源userId, page?
{"method": "getUserResources", "params": {"userId":123}}
getFeaturedResources精选资源limit?
{"method": "getFeaturedResources", "params": {"limit":10}}
createResource发布资源categoryId, title, description
{"method": "createResource", "params": {"categoryId":1,"title":"标题"}}
updateResource更新资源resourceId, title?, description?
{"method": "updateResource", "params": {"resourceId":456}}
addResourceVersion添加资源版本resourceId, version, file?
{"method": "addResourceVersion", "params": {"resourceId":456,"version":"1.0"}}
getResourceVersions获取资源版本resourceId
{"method": "getResourceVersions", "params": {"resourceId":456}}
addResourceReview评价资源resourceId, rating, message
{"method": "addResourceReview", "params": {"resourceId":456,"rating":5}}
getResourceReviews资源评价resourceId, page?
{"method": "getResourceReviews", "params": {"resourceId":456}}
deleteResource删除资源resourceId
{"method": "deleteResource", "params": {"resourceId":456}}
likeResource点赞资源resourceId
{"method": "likeResource", "params": {"resourceId":456}}
unlikeResource取消点赞resourceId
{"method": "unlikeResource", "params": {"resourceId":456}}
purchaseResource购买资源resourceId
{"method": "purchaseResource", "params": {"resourceId":456}}
checkResourcePurchase检查购买状态resourceId
{"method": "checkResourcePurchase", "params": {"resourceId":456}}
getPurchasedResources已购资源page?
{"method": "getPurchasedResources", "params": {"page":1}}

16. 积分接口 (Credits)

方法描述参数示例
getCurrencyList货币列表
{"method": "getCurrencyList", "params": {}}
getCreditsRanking积分排行limit?
{"method": "getCreditsRanking", "params": {"limit":20}}
getCreditsInfo积分信息
{"method": "getCreditsInfo", "params": {}}
getUserCredits用户积分userId?
{"method": "getUserCredits", "params": {"userId":123}}
getTransactionList交易记录page?, limit?
{"method": "getTransactionList", "params": {"page":1}}
getTransactionDetail交易详情transactionId
{"method": "getTransactionDetail", "params": {"transactionId":1}}
transferCredits转让积分toUserId, amount, message?
{"method": "transferCredits", "params": {"toUserId":123,"amount":100}}
dailyCheckIn每日签到
{"method": "dailyCheckIn", "params": {}}
getCheckInStatus签到状态
{"method": "getCheckInStatus", "params": {}}
sendRedPacket发红包toUserId, amount, quantity?
{"method": "sendRedPacket", "params": {"toUserId":123,"amount":100}}
grabRedPacket抢红包redPacketId
{"method": "grabRedPacket", "params": {"redPacketId":1}}
getRedPacketInfo红包信息redPacketId
{"method": "getRedPacketInfo", "params": {"redPacketId":1}}
openBonus开启红包bonusId
{"method": "openBonus", "params": {"bonusId":1}}
createBonus创建红包amount, quantity, type?
{"method": "createBonus", "params": {"amount":100,"quantity":5}}

17. 公告接口 (Announcement)

方法描述参数示例
getAnnouncements获取公告列表limit?
{"method": "getAnnouncements", "params": {"limit":10}}
getAnnouncement获取公告详情announcementId
{"method": "getAnnouncement", "params": {"announcementId":1}}
dismissAnnouncement忽略公告announcementId
{"method": "dismissAnnouncement", "params": {"announcementId":1}}
undismissAnnouncement取消忽略announcementId
{"method": "undismissAnnouncement", "params": {"announcementId":1}}
后退
顶部 底部