Skip to content

luutruong/XF2_Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add-on enhancement to XenForo API

This document only provides API which the add-on makes an enhancement. To view other API end points please go to Official XenForo API docs

All requests must be include there keys in headers:

  • XF-TApi-Key
  • XF-TApi-Token: If omitted the request processed for Guest user.

Auth

POST /tapi-apps/auth

Parameters:

  • username (string) required
  • password (string) required: Password must be encrypted.

Response:

{
  user: (user),
  accessToken: (string)
}

POST /tapi-apps/register

Parameters:

  • username (string) required
  • email (string) required
  • password (string) required: Password must be encrypted.
  • birthday (string) optional: Birthday must be formatted Y-m-d. Eg: 2021-12-15

Response:

{
  user: (user),
  accessToken: (string)
}

Conversations

GET /conversations

Get list conversations by current visitor. Requires valid user access token. XenForo API Docs

POST /conversations

Creating a conversation.

Extra parameters:

  • recipients (string) optional: Create with conversation with many recipients. Each recipient name separate by comma (,).
  • tapi_recipients (bool) optional: Include recipients in conversation object.
  • Other params

Response:

{
  "conversation: (conversation)
}

GET /conversations/:conversationId

Get specific conversation details.

Extra parameters:

  • tapi_recipients (bool) optional: Include recipients in conversation object.
  • Other params

Response:

{
  "conversation": (conversation)
}

GET /conversation-messages/:messageId/tapi-reactions

Get reactions on specific conversation message.

Parameters:

  • reaction_id (int) optional: Filter show specific reaction.

Response:

{
  "reactions": [
    (reaction)
  ]
}

Forums

GET /forums/:forumId/prefixes

Parameters:

  • N/A

Response:

{
  "prefix_groups": any[],
  "prefixes": [
    (prefix),
    ...
  ],
  "prefix_tree": int[],
}

POST /forums/:forumId/watch

Parameters:

  • N/A

Response:

{
  "message": (string)
}

GET /forums/:forumId/threads

Parameters:

  • started_by (string) optional: Filter threads were created by specific user name.
  • with_first_post (bool) optional: Determine include FirstPost in the thread data.
  • Other params

Response:

{
  "threads": [
    (thread),
    ...
  ]
}

ME

GET /me/ignoring

Parameters:

  • N/A

Response:

{
  "users": [
    (user),
    ...
  ]
}

POST /me/ignoring

Ignore a user

Parameters:

  • user_id (int) required

Response:

{
  "message": (string)
}

DELETE /me/ignoring

Unignore a user

Parameters:

  • N/A

Response:

{
  "message": (string)
}

GET /me/watched-threads

Parameters:

  • page (int) optional

Response:

{
  "threads": [
    (thread),
    ...
  ],
  "pagination": (pagination)
}

MISC

POST /tapi-batch

Send a numerous requests in a single request. This API requires body is JSON which contains the following info:

[
  {
    "uri": (string),
    "method": (string),
    "params": {
      "foo": "baz",
      ...
    }
  }
]

Posts

POST /posts/:postId/report

Parameters:

  • message (string) required

Response:

{
  "message": (string)
}

GET /posts/:postId/tapi-reactions

Parameters:

  • reaction_id (int) optional: Filter show specific reaction.

Response:

{
  "reactions": [
    (reaction)
  ]
}

Profile Posts

POST /profile-posts/:profilePostId/report

Parameters:

  • message (string) required

Response:

{
  "message": (string)
}

GET /profile-posts/:profilePostId/tapi-reactions

Parameters:

  • reaction_id (int) optional: Filter show specific reaction.

Response:

{
  "reactions": [
    (reaction)
  ]
}

POST /profile-post-comments/:profilePostCommentId/report

Parameters:

  • message (string) required

Response:

{
  "message": (string)
}

GET /profile-post-comments/:profilePostCommentId/tapi-reactions

Parameters:

  • reaction_id (int) optional: Filter show specific reaction.

Response:

{
  "reactions": [
    (reaction)
  ]
}

Threads

GET /threads/:threadId

Parameters:

  • post_id (int) optional
  • is_unread (int) optional
  • Other params

Response:

{
  "thread": (thread)
}

POST /threads/:threadId/watch

Parameters:

  • N/A

Response:

{
  "is_watched": (bool)
}

Users

GET /users/:userId/following

Parameters:

  • page (int) optional

Response:

{
  "users": [
    (user),
    ...
  ],
  "pagination": (pagination)
}

POST /users/:userId/following

Make current visitor follow this user

Parameters:

  • N/A

Response:

{
  "message": (string)
}

DELETE /users/:userId/following

Make current visitor unfollow this user

Parameters:

  • N/A

Response:

{
  "message": (string)
}

POST /users/:userId/report

Parameters:

  • message (string) required

Response:

{
  "message": (string)
}

GET /users/:userId/threads

Parameters:

  • page (int) optional

Response:

{
  "threads": [
    (thread),
    ...
  ],
  "pagination": (pagination)
}

DELETE /me

Self-delete user account.

Parameters:

  • N/A

Response:

{
  "message": (string)
}

POST /tapi-apps/search

Searching content...

Parameters:

  • keywords required
  • search_type optional. Allowed values: thread, post, user.
  • search_order optional. Allowed values: date, relevance*

Response:

{
  "keywords": (string),
  "search_id": (int),
  "results": (any),
  "pagination": (pagination)
}

POST /tapi-apps/connected-accounts

Associate with external account.

Parameters:

  • provider required. Connected account provider ID.
  • token required. The access token.

Response:

{
  "user": (user),
  "accessToken": (string)
}

POST /me/username

Request to change username

Parameters:

  • username required: New username
  • change_reason required

Response:

{
  "message": (string),
  "changeState": (string),
}

Encrypt password

Please see the method Util\PasswordDecrypter::encrypt(...)