### NodeBB API: Sample Response (Get Post Replies) Source: https://docs.nodebb.org/api/write Example JSON response structure for retrieving post replies, including revision details like timestamps, usernames, and editability flags. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "uid": 0, "pid": 0, "timestamps": [ "string" ], "revisions": [ { "timestamp": "string", "username": "string", "uid": 0 } ], "editable": true, "deletable": true } } ``` -------------------------------- ### Response Sample (JSON) Source: https://docs.nodebb.org/api/write Example JSON response structure for various API operations, indicating status and response data. ```JSON { "status": { "code": "ok", "message": "OK" }, "response": {} } ``` -------------------------------- ### NodeBB API: Sample Response (Post Data Structure) Source: https://docs.nodebb.org/api/write Example JSON response structure detailing a post's data, including status, user information, topic details, category information, and reply count. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "pid": 0, "tid": 0, "toPid": 0, "url": "string", "content": "string", "sourceContent": "string", "uid": 0, "timestamp": 0, "deleted": true, "upvotes": 0, "downvotes": 0, "votes": 0, "timestampISO": "string", "user": { "uid": 0, "isLocal": true, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "icon:text": "string", "icon:bgColor": "#f44336" }, "topic": { "uid": 0, "tid": 0, "title": "string", "cid": 0, "slug": "string", "deleted": 0, "scheduled": 0, "timestamp": 0, "timestampISO": "string", "postcount": 0, "mainPid": 0, "teaserPid": 0, "titleRaw": "string", "oldTitle": "string", "isMainPost": true, "renamed": true, "tags": [ { "value": "string", "score": 0, "class": "string", "valueEscaped": "string", "valueEncoded": "string" } ] }, "category": { "cid": 0, "name": "string", "icon": "string", "slug": "string", "parentCid": 0, "bgColor": "string", "color": "string", "backgroundImage": null, "imageClass": "string" }, "isMainPost": true, "replies": 0 } } ``` -------------------------------- ### NodeBB API: Get Chat Room Response Sample Source: https://docs.nodebb.org/api/write Provides a sample JSON response for retrieving chat room details. This includes information about the room, users, and messages. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "roomId": 0, "roomName": "string", "groupChat": true, "public": true, "userCount": 0, "messageCount": 0, "groups": [ ], "timestamp": 0, "notificationSetting": 0, "joinLeaveMessages": 0, "content": "string", "fromuid": 0, "deleted": 0, "system": 0, "edited": 0, "timestampISO": "string", "editedISO": "string", "mid": 0, "messageId": 0, "isOwner": true, "fromUser": { "uid": 0, "isLocal": true, "username": "Dragon Fruit", "userslug": "dragon-fruit", "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "status": "online", "banned": false, "displayname": "Dragon Fruit", "icon:text": "string", "icon:bgColor": "#f44336", "banned_until_readable": "Not Banned", "deleted": true }, "self": 0, "newSet": true, "users": [ { "uid": 0, "username": "string", "picture": "string", "status": "string", "displayname": "string", "icon:text": "string", "icon:bgColor": "#f44336", "isOwner": true } ], "canReply": true, "usernames": "string", "maximumUsersInChatRoom": 0, "maximumChatMessageLength": 0, "showUserInput": true, "isAdminOrGlobalMod": true } } ``` -------------------------------- ### NodeBB API: Sample Response (Post Operations) Source: https://docs.nodebb.org/api/write Example JSON response structure for successful post-related operations, indicating a status of 'ok' with a 'message' of 'OK'. The 'response' object may contain details depending on the operation. ```json { "status": { "code": "ok", "message": "OK" }, "response": {} } ``` -------------------------------- ### Move Topic Payload (JSON) Source: https://docs.nodebb.org/api/write Example JSON payload for moving a topic, specifying the target category ID. ```JSON { "cid": -1 } ``` -------------------------------- ### Get User Information Source: https://docs.nodebb.org/api/write Retrieves detailed information about a specific user, including their username, email, join date, and profile details. The response is in JSON format. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "uid": 1, "username": "Dragon Fruit", "userslug": "dragon-fruit", "email": "dragonfruit@example.org", "email:confirmed": 1, "joindate": 1585337827953, "lastonline": 1585337827953, "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "fullname": "Mr. Dragon Fruit Jr.", "displayname": "Dragon Fruit", "location": "Toronto, Canada", "birthday": "03/27/2020", "website": "https://example.org", "aboutme": "This is a paragraph all about how my life got twist-turned upside-down\nand I'd like to take a minute and sit right here,\nto tell you all about how I because the administrator of NodeBB\n", "signature": "This is an example signature\nIt can span multiple lines.\n", "uploadedpicture": "/assets/profile/1-profileimg.png", "profileviews": 1000, "reputation": 100, "postcount": 1000, "topiccount": 50, "lastposttime": 1585337827953, "banned": 0, "banned:expire": 1585337827953, "status": "online", "flags": 0, "followercount": 2, "followingcount": 5, "cover:url": "/assets/profile/1-cover.png", "cover:position": "50.0301% 19.2464%", "groupTitle": "[\"administrators\",\"Staff\"]", "groupTitleArray": [ "administrators", "Staff" ], "icon:text": "D", "icon:bgColor": "#9c27b0", "joindateISO": "2020-03-27T20:30:36.590Z", "lastonlineISO": "2020-03-27T20:30:36.590Z", "banned_until": 0, "banned_until_readable": "Not Banned" } } ``` -------------------------------- ### Get Pinned Messages in Chat Room (REST) Source: https://docs.nodebb.org/api/write Fetches a list of pinned messages for a chat room, with a limit of 50 items and support for offset via the 'start' parameter. The user must be part of the chat room. ```shell GET /api/v3/chats/{roomId}/messages/pinned?start=0 ``` -------------------------------- ### NodeBB API: Get Subcategories Sample Response Source: https://docs.nodebb.org/api/write This snippet displays a sample JSON response when fetching subcategories for a category in NodeBB. It lists various properties of each subcategory. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "categories": [ { "cid": 0, "name": "string", "handle": "string", "description": "string", "descriptionParsed": "string", "icon": "fa-comments-o", "bgColor": "string", "color": "string", "slug": "string", "parentCid": 0, "topic_count": 0, "post_count": 0, "disabled": 0, "order": 0, "link": "string", "numRecentReplies": 0, "class": "string", "imageClass": "auto", "isSection": 0, "minTags": 0, "maxTags": 0, "postQueue": 0, "totalPostCount": 0, "totalTopicCount": 0, "subCategoriesPerPage": 0, "backgroundImage": "string" } ] } } ``` -------------------------------- ### Get Chat Room Messages (REST) Source: https://docs.nodebb.org/api/write Retrieves messages from a chat room, supporting pagination. Requires the room ID and optionally accepts user ID and start index as query parameters. ```shell GET /api/v3/chats/{roomId}/messages?uid=1&start=0 ``` -------------------------------- ### NodeBB API List Recent Chat Rooms GET Request Source: https://docs.nodebb.org/api/write This endpoint retrieves a list of recent chat rooms for the authenticated user. It supports pagination through 'start' and 'perPage' query parameters. The 'page' parameter is deprecated. ```http GET /api/v3/chats/ Query Parameters: start: number (e.g., 20) - The starting index for chat rooms. perPage: number (e.g., 20) - The number of chat rooms per page. page: number (Deprecated) - The page number. ``` -------------------------------- ### NodeBB API: Get Posts Sample Response Source: https://docs.nodebb.org/api/write This snippet shows a sample JSON response for retrieving posts from the NodeBB API. It includes details about the post's content, author, topic, and category. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "posts": [ { "pid": 0, "tid": 0, "toPid": 0, "url": "string", "content": "string", "sourceContent": "string", "uid": 0, "timestamp": 0, "deleted": true, "upvotes": 0, "downvotes": 0, "votes": 0, "timestampISO": "string", "user": { "uid": 0, "isLocal": true, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "icon:text": "string", "icon:bgColor": "#f44336" }, "topic": { "uid": 0, "tid": 0, "title": "string", "cid": 0, "slug": "string", "deleted": 0, "scheduled": 0, "timestamp": 0, "timestampISO": "string", "postcount": 0, "mainPid": 0, "teaserPid": 0, "titleRaw": "string", "oldTitle": "string", "isMainPost": true, "renamed": true, "tags": [ { "value": "string", "score": 0, "class": "string", "valueEscaped": "string", "valueEncoded": "string" } ] }, "category": { "cid": 0, "name": "string", "icon": "string", "slug": "string", "parentCid": 0, "bgColor": "string", "color": "string", "backgroundImage": null, "imageClass": "string" }, "isMainPost": true, "replies": 0, "attachments": [] } ] } } ``` -------------------------------- ### NodeBB API: Get Analytics Keys Source: https://docs.nodebb.org/api/write Returns a list of metrics tracked by NodeBB. This endpoint is accessible only to administrators. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "keys": [] } } ``` -------------------------------- ### Get Category Topics API Response Sample Source: https://docs.nodebb.org/api/write This is a sample JSON response for the get/categories/{cid}/topics API endpoint. It includes details about the status, the list of topics with their properties (title, author, timestamps, counts, etc.), category information, user details, and pagination data. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "topics": [ { "tid": 0, "uid": 0, "cid": 0, "title": "string", "slug": "string", "mainPid": 0, "postcount": 0, "viewcount": 0, "postercount": 0, "followercount": 0, "scheduled": 0, "deleted": 0, "deleterUid": 0, "titleRaw": "string", "locked": 0, "pinned": 0, "timestamp": 0, "timestampISO": "string", "lastposttime": 0, "lastposttimeISO": "string", "pinExpiry": 0, "pinExpiryISO": "string", "upvotes": 0, "downvotes": 0, "votes": 0, "teaserPid": 0, "thumbs": [ { "id": 0, "name": "string", "path": "string", "url": "string" } ], "numThumbs": 0, "category": { "cid": 0, "name": "string", "slug": "string", "icon": "string", "backgroundImage": "string", "imageClass": "string", "bgColor": "string", "color": "string", "disabled": 0 }, "user": { "uid": 0, "isLocal": true, "username": "string", "displayname": "string", "fullname": "string", "userslug": "string", "reputation": 0, "postcount": 0, "picture": "string", "signature": "string", "banned": 0, "status": "string", "icon:text": "string", "icon:bgColor": "#f44336", "banned_until_readable": "string" }, "teaser": { "pid": 0, "uid": 0, "timestamp": 0, "tid": 0, "content": "string", "sourceContent": "string", "timestampISO": "string", "user": { "uid": 0, "username": "string", "displayname": "string", "isLocal": true, "userslug": "string", "picture": "string", "icon:text": "string", "icon:bgColor": "#f44336" }, "index": 0 }, "tags": [ { "value": "string", "valueEscaped": "string", "color": "string", "bgColor": "string", "score": 0 } ], "isOwner": true, "ignored": true, "followed": true, "unread": true, "bookmark": 0, "unreplied": true, "icons": [ "string" ], "thumb": "string", "index": 0 } ], "nextStart": 0, "privileges": { "property1": true, "property2": true } } } ``` -------------------------------- ### Test NodeBB Write API Connectivity (GET) Source: https://docs.nodebb.org/api/write This utility route checks if the NodeBB Write API is enabled and accessible. It returns a '200 OK' status if the API is active, confirming that the instance supports v3 of the Write API. No authentication is required. ```HTTP GET /api/v3/ping ``` -------------------------------- ### Edit Post Payload (JSON) Source: https://docs.nodebb.org/api/write Example JSON payload for editing a post, including content and an optional title. ```JSON { "content": "New post content", "title": "New title" } ``` -------------------------------- ### NodeBB API: Get API Token Source: https://docs.nodebb.org/api/write Retrieves an existing API token and its associated metadata using the token string as a path parameter. -------------------------------- ### Get Post (GET /posts/{pid}) Source: https://docs.nodebb.org/api/write Retrieves the data for a specific post. Requires a valid post ID (pid). ```HTTP GET /posts/{pid} https://try.nodebb.org/api/v3/posts/{pid} ``` -------------------------------- ### NodeBB API - Get Post Summary Source: https://docs.nodebb.org/api/write Retrieves a comprehensive summary of a post, including user, topic, and category details, with parsed content. Requires a valid post ID. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "pid": 0, "tid": 0, "toPid": 0, "url": "string", "content": "string", "sourceContent": "string", "uid": 0, "timestamp": 0, "deleted": true, "upvotes": 0, "downvotes": 0, "votes": 0, "timestampISO": "string", "user": { "uid": 0, "isLocal": true, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "icon:text": "string", "icon:bgColor": "#f44336" }, "topic": { "uid": 0, "tid": 0, "title": "string", "cid": 0, "slug": "string", "deleted": 0, "scheduled": 0, "timestamp": 0, "timestampISO": "string", "postcount": 0, "mainPid": 0, "teaserPid": 0, "titleRaw": "string", "oldTitle": "string", "isMainPost": true, "renamed": true, "tags": [ { "value": "string", "score": 0, "class": "string", "valueEscaped": "string", "valueEncoded": "string" } ] }, "category": { "cid": 0, "name": "string", "icon": "string", "slug": "string", "parentCid": 0, "bgColor": "string", "color": "string", "backgroundImage": null, "imageClass": "string" }, "isMainPost": true, "replies": 0, "edited": true, "deleterUid": 0 } } ``` -------------------------------- ### NodeBB API: Get User List Sample Response Source: https://docs.nodebb.org/api/write This is a sample JSON response for retrieving a list of users within a group from the NodeBB API. It includes user details such as UID, username, status, and join date. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "users": [ { "uid": 1, "isLocal": true, "username": "Dragon Fruit", "displayname": "Dragon Fruit", "userslug": "dragon-fruit", "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "status": "online", "postcount": 1000, "reputation": 100, "email:confirmed": 1, "lastonline": 1585337827953, "flags": 0, "banned": 0, "banned:expire": 1585337827953, "joindate": 1585337827953, "icon:text": "D", "icon:bgColor": "#9c27b0", "joindateISO": "2020-03-27T20:30:36.590Z", "lastonlineISO": "2020-03-27T20:30:36.590Z", "banned_until": 0, "banned_until_readable": "Not Banned", "isOwner": true } ], "matchCount": 0, "timing": "string", "nextStart": 0 } } ``` -------------------------------- ### NodeBB API: Get Post Replies Source: https://docs.nodebb.org/api/write Retrieves all direct replies to a given post. Requires the post ID as a path parameter. ```http GET /api/v3/posts/{pid}/replies Host: try.nodebb.org Content-Type: application/json ``` -------------------------------- ### Get Post Announcer Usernames for Tooltip Source: https://docs.nodebb.org/api/write Fetches a list of usernames for announcers of a post, intended for display in tooltips. Requires a valid post ID (pid). ```json { "status": { "code": "ok", "message": "OK" }, "response": { "otherCount": 0, "usernames": [ ], "cutoff": 0 } } ``` -------------------------------- ### NodeBB API - Synchronize Category Request Payload Source: https://docs.nodebb.org/api/write Example JSON payload for synchronizing a NodeBB category with an external ActivityPub actor. It specifies the actor's URI. ```json { "actor": "https://example.org/foobar" } ``` -------------------------------- ### NodeBB API: Get User Response (200 OK) Source: https://docs.nodebb.org/api/write A successful response (HTTP 200 OK) when retrieving a single user account. It contains detailed profile information for the specified user. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "uid": 1, "isLocal": true, "username": "Dragon Fruit", "displayname": "Dragon Fruit", "userslug": "dragon-fruit", "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "status": "online", "postcount": 1000, "reputation": 100, "email:confirmed": 1, "lastonline": 1585337827953, "flags": 0, "banned": 0, "banned:expire": 1585337827953, "joindate": 1585337827953, "icon:text": "D", "icon:bgColor": "#9c27b0", "joindateISO": "2020-03-27T20:30:36.590Z", "lastonlineISO": "2020-03-27T20:30:36.590Z", "banned_until": 0, "banned_until_readable": "Not Banned" } } ``` -------------------------------- ### NodeBB API: Get User Invitable Groups Response Sample Source: https://docs.nodebb.org/api/write This is a sample response for retrieving group names that a user can invite others to. It returns a JSON array of strings, where each string is a group name. ```json [ "string" ] ``` -------------------------------- ### Generate User Export Source: https://docs.nodebb.org/api/write Initiates the generation of a user export file for a specified user and export type. The API returns a 202 Accepted status, indicating the request is being processed. Clients should poll the HEAD method for completion (204 No Content) before calling GET to download the file. ```http POST /api/v3/users/{uid}/exports/{type} HTTP/1.1 Host: try.nodebb.org Content-Type: application/json { "status": { "code": "ok", "message": "OK" }, "response": {} } ``` -------------------------------- ### Get User Status Source: https://docs.nodebb.org/api/write Retrieves the status of a user based on their UID and a specified status. Returns 200 on success or 404 if the user status does not match the provided value. ```HTTP GET /api/v3/users/{uid}/status/{status} ``` -------------------------------- ### Get Invited Users for a Group Source: https://docs.nodebb.org/api/write Retrieves a list of users invited to a specific group. Requires a group slug as a path parameter. The response includes user details such as UID, username, and display name. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "pending": [ { "uid": 1, "username": "Dragon Fruit", "userslug": "dragon-fruit", "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "displayname": "Dragon Fruit", "icon:text": "D", "icon:bgColor": "#9c27b0" } ] } } ``` -------------------------------- ### NodeBB API: Get Topics Endpoint Source: https://docs.nodebb.org/api/write This snippet outlines the NodeBB API endpoint for retrieving topics within a specified category. The number of topics returned is controlled by the 'Topics per Page' setting. ```http GET /api/v3/categories/{cid}/topics ``` -------------------------------- ### Get Chat Room Source: https://docs.nodebb.org/api/write Retrieves a private chat room associated with a user. Requires the user's UID as a path parameter. Returns a JSON object with room details on success. ```HTTP GET /api/v3/users/{uid}/chat ``` ```JSON { "status": { "code": "ok", "message": "OK" }, "response": { "roomId": 0 } } ``` -------------------------------- ### NodeBB API: Get Chat Room Data Response (200 OK) Source: https://docs.nodebb.org/api/write This snippet shows a successful response (HTTP 200) for retrieving detailed information about a specific chat room. It includes room details, user information, and message previews. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "roomId": 0, "roomName": "string", "groupChat": true, "public": true, "userCount": 0, "messageCount": 0, "groups": [ ], "timestamp": 0, "notificationSetting": 0, "joinLeaveMessages": 0, "unread": true, "teaser": { "fromuid": 0, "content": "string", "timestamp": 0, "timestampISO": "string", "user": { "uid": 0, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "lastonline": 0, "icon:text": "string", "icon:bgColor": "#f44336", "lastonlineISO": "string" } }, "users": [ { "uid": 0, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "lastonline": 0, "icon:text": "string", "icon:bgColor": "#f44336", "lastonlineISO": "string" } ], "lastUser": { "uid": 0, "username": "string", "displayname": "string", "userslug": "string", "picture": "string", "status": "string", "lastonline": 0, "icon:text": "string", "icon:bgColor": "#f44336", "lastonlineISO": "string" }, "usernames": "string" } } ``` -------------------------------- ### NodeBB API: Follow Topic Response Sample Source: https://docs.nodebb.org/api/write This is a sample JSON response for a successful topic follow operation in the NodeBB API. It indicates an 'ok' status. ```json { "status": { "code": "ok", "message": "OK" }, "response": { } } ``` -------------------------------- ### NodeBB API Admin Configuration Source: https://docs.nodebb.org/api/write Allows administrators to manage NodeBB's configuration settings, including updating settings, managing API tokens, and configuring various aspects of the platform. ```javascript // Example: Update a configuration setting nodebbApi.admin.updateConfig({ settingName: 'newValue' }).then(response => { console.log('Configuration updated:', response); }).catch(error => { console.error('Error updating configuration:', error); }); // Example: Create an API token nodebbApi.admin.createToken({ name: 'My API Token' }).then(response => { console.log('Token created:', response); }).catch(error => { console.error('Error creating token:', error); }); ``` -------------------------------- ### NodeBB API: Get Flag Response Sample Source: https://docs.nodebb.org/api/write This JSON object represents a successful response (HTTP 200) when retrieving flag information from the NodeBB API. It includes status details and a comprehensive response object detailing the flag's state, history, and associated user information. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "state": "string", "flagId": 0, "type": "string", "targetId": 0, "targetUid": 0, "datetime": 0, "datetimeISO": "string", "target_readable": "string", "target": { "property1": null, "property2": null }, "assignee": 0, "reports": [ { "value": "string", "timestamp": 0, "timestampISO": "string", "reporter": { "username": "string", "displayname": "string", "userslug": "string", "picture": null, "reputation": 0, "uid": 0, "isLocal": true, "icon:text": "string", "icon:bgColor": "#f44336" } } ], "history": [ { "uid": 0, "fields": { "property1": null, "property2": null }, "meta": [ { "key": "string", "value": "string", "labelClass": "default" } ], "datetime": 0, "datetimeISO": "string", "user": { "username": "string", "displayname": "string", "userslug": "string", "picture": null, "uid": 0, "isLocal": true, "icon:text": "string", "icon:bgColor": "#f44336" } } ], "notes": [ { "uid": 0, "content": "string", "datetime": 0, "datetimeISO": "string", "user": { "username": "string", "userslug": "string", "displayname": "Dragon Fruit", "picture": "string", "uid": 0, "isLocal": true, "icon:text": "string", "icon:bgColor": "#f44336" } } ] } } ``` -------------------------------- ### Get Topic Events Source: https://docs.nodebb.org/api/write Retrieves a list of events associated with a specific topic. Requires a valid topic ID. ```http GET /api/v3/topics/{tid}/events GET https://try.nodebb.org/api/v3/topics/{tid}/events ``` -------------------------------- ### NodeBB API: Create User Response (200 OK) Source: https://docs.nodebb.org/api/write A successful response (HTTP 200 OK) when creating a user in NodeBB. It confirms the user creation and includes basic user information like UID, username, and email. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "uid": 1, "username": "Dragon Fruit", "userslug": "dragon-fruit", "email": "dragonfruit@example.org", "email:confirmed": 1, "joindate": 1585337827953, "lastonline": 1585337827953, "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "fullname": "Mr. Dragon Fruit Jr.", "displayname": "Dragon Fruit", "location": "Toronto, Canada", "birthday": "03/27/2020", "website": "https://example.org", "aboutme": "This is a paragraph all about how my life got twist-turned upside-down\nand I'd like to take a minute and sit right here,\nto tell you all about how I because the administrator of NodeBB\n", "signature": "This is an example signature\nIt can span multiple lines.\n", "uploadedpicture": "/assets/profile/1-profileimg.png", "profileviews": 1000, "reputation": 100, "postcount": 1000, "topiccount": 50, "lastposttime": 1585337827953, "banned": 0, "banned:expire": 1585337827953, "status": "online", "flags": 0, "followercount": 2, "followingcount": 5, "cover:url": "/assets/profile/1-cover.png", "cover:position": "50.0301% 19.2464%", "groupTitle": "[\"administrators\",\"Staff\"]", "groupTitleArray": [ "administrators", "Staff" ], "icon:text": "D", "icon:bgColor": "#9c27b0", "joindateISO": "2020-03-27T20:30:36.590Z", "lastonlineISO": "2020-03-27T20:30:36.590Z", "banned_until": 0, "banned_until_readable": "Not Banned" } } ``` -------------------------------- ### NodeBB API Response Sample (200 OK) Source: https://docs.nodebb.org/api/write This is a sample JSON response from the NodeBB API, indicating a successful operation. It includes status information and a response payload, which can vary depending on the specific API call. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "labelData": [ { "label": "string", "type": "string" } ], "users": [ { "uid": 1, "isLocal": true, "username": "Dragon Fruit", "displayname": "Dragon Fruit", "picture": "https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80", "icon:text": "D", "icon:bgColor": "#9c27b0", "banned": 0, "banned_until_readable": "Not Banned", "privileges": { "property1": true, "property2": true }, "types": {} } ], "groups": [ { "name": "string", "nameEscaped": "string", "privileges": { "property1": true, "property2": true }, "types": {}, "isPrivate": true, "isSystem": true } ], "keys": { "users": [ "string" ], "groups": [ "string" ] }, "columnCountUserOther": 0, "columnCountGroupOther": 0 } } ``` -------------------------------- ### NodeBB API: List group members Source: https://docs.nodebb.org/api/write This endpoint returns a list of members within a specified group. Group owners are listed at the top. The operation supports optional query parameters for searching or pagination. It uses an HTTP GET request to the /api/v3/groups/{slug}/members endpoint. ```http GET /api/v3/groups/{slug}/members?query=a HTTP/1.1 Host: try.nodebb.org ``` ```http GET /api/v3/groups/{slug}/members?after=0 HTTP/1.1 Host: try.nodebb.org ``` -------------------------------- ### NodeBB API Topic Management Source: https://docs.nodebb.org/api/write Covers the creation, retrieval, updating, and deletion of topics within NodeBB. It also includes functionalities for replying to topics, managing topic state (lock, pin, follow), and handling tags. ```javascript // Example: Create a new topic nodebbApi.topics.create({ cid: 'categoryId', title: 'New Topic Title', content: 'This is the content of the new topic.' }).then(response => { console.log('Topic created:', response); }).catch(error => { console.error('Error creating topic:', error); }); // Example: Get a topic nodebbApi.topics.get('topicId').then(response => { console.log('Topic data:', response); }).catch(error => { console.error('Error getting topic:', error); }); // Example: Reply to a topic nodebbApi.topics.reply('topicId', { content: 'This is a reply to the topic.' }).then(response => { console.log('Reply posted:', response); }).catch(error => { console.error('Error posting reply:', error); }); ``` -------------------------------- ### NodeBB API: Unignore Topic Response Sample Source: https://docs.nodebb.org/api/write This is a sample JSON response for a successful topic unignore operation in the NodeBB API. It indicates an 'ok' status. ```json { "status": { "code": "ok", "message": "OK" }, "response": { } } ``` -------------------------------- ### NodeBB API: Add Topic Tags Response Sample Source: https://docs.nodebb.org/api/write This is a sample JSON response for a successful topic tag addition operation in the NodeBB API. It indicates an 'ok' status. ```json { "status": { "code": "ok", "message": "OK" }, "response": [ { }, { } ] } ``` -------------------------------- ### NodeBB API: Get Pending Group Members Source: https://docs.nodebb.org/api/write This API endpoint retrieves a list of users who have requested membership to a specific group. ```http GET /api/v3/groups/{slug}/pending ``` -------------------------------- ### NodeBB API: Get Analytics Data Source: https://docs.nodebb.org/api/write Retrieves analytics data from NodeBB for a specified set, with options for units, end time, and count. Accessible only to administrators. ```json { "status": { "code": "ok", "message": "OK" }, "response": [ 0 ] } ``` -------------------------------- ### NodeBB API: Get Message IP Address Source: https://docs.nodebb.org/api/write Retrieves the IP address recorded when a chat message was saved. Requires roomId and mid as path parameters. ```json { "status": { "code": "ok", "message": "OK" }, "response": { "content": "string" } } ``` -------------------------------- ### Create NodeBB Topic Source: https://docs.nodebb.org/api/write Creates a new topic in NodeBB. Requires a JSON payload containing the category ID, title, content, and an optional timestamp and tags. The response includes details of the successfully created topic. ```json { "cid": 1, "title": "Test topic", "content": "This is the test topic's content", "timestamp": 556084800000, "tags": [ "test", "topic" ] } ``` -------------------------------- ### Get Post Announcer Information Source: https://docs.nodebb.org/api/write Retrieves data about announcers for a specific post, provided the user has the necessary permissions. Requires a valid post ID (pid). ```json { "status": { "code": "ok", "message": "OK" }, "response": { "announceCount": 0, "announcers": [ ] } } ``` -------------------------------- ### Verify Login Credentials and Initialize Session (POST) Source: https://docs.nodebb.org/api/write This route validates user login credentials (username/password or email/password) and returns a user object upon successful validation. It also initiates a login session, providing a cookie for subsequent authenticated API calls. Note that non-GET requests require a CSRF token for cookie-based sessions. ```HTTP POST /api/v3/utilities/login ```