📙
Sunbird Lern
AskDot
  • LEARN
    • Overview
    • Functional Capabilities
    • Technical Architecture
      • Technical Architecture Diagram
      • Tech Stack
    • Dependencies
    • Product Roadmap
  • USE
    • Overview
    • Release Notes
      • Release V 8.0.0 (Ongoing)
      • Release V 7.0.0
      • Release V 5.4.0
      • Release V 5.3.0
      • Release V 5.2.0
      • Release V 5.1.0
      • Release V 5.0.1
      • Release V 5.0.0
      • Release V 4.10.0
      • Release V 4.9.0
      • Release V 4.8.0
      • Release V 4.7.0
    • Developer Guide
      • USER & ORG SERVICE
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Keycloak Local setup
          • Additional Installation Dependencies:
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
              • User
              • Organisation
              • System Settings
              • Role
              • Bulk Upload Process
              • Tenant Preference
              • Cassandra Migration Version
              • User Consent
              • Email Template
              • OTP
              • Page Management (LMS Service)
              • Location
              • User Notes
              • Deprecated
          • Elastic Search
          • Redis
        • APIs
          • User Management
            • User Deletion API
            • Ownership Transfer API
          • Organisation Management
          • Location Management
          • Consent Management
          • OTP Services
          • Tenant Configurations
          • Bulk Upload
          • System Settings
          • API Management Service
          • Data Sync
          • Notification APIs
        • Flink Jobs
          • User Cache Updater
          • User Deletion Cleanup Flink Job
          • Ownership Transfer Flink Job
        • Reports
          • Standard Exhaust
            • State Admin Geo report
            • State Admin Report
          • Other Jobs
            • User Cache Indexer Job
            • Delete Users Assets Report
          • Data Products Developer Installation
            • System Requirements
            • Tech Stack
            • Installation Dependencies
            • Local installation of data-products
            • Server setup Guide
            • Installation Configuration
            • Data-product creation guide
            • Troubleshooting a data-product
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
          • System Settings
          • Email Configuration
          • SMS Configuration
          • OTP based SMS Configuration
        • Roles
          • System Roles
          • User Roles
          • RBAC
        • Dependencies
        • Keycloak on Sunbird
        • How to Guide
          • Create Organization
          • Create User
          • Add new user type & location
        • Single Sign-on with Sunbird
        • Caching and Denormalising User Metadata
          • ETLUserCacheUpdaterJob
          • UserCacheUpdaterFlinkJob
        • Unit Tests and Code Coverage
        • FAQs
      • LMS(BATCH) SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
        • Data Models
          • Cassandra
            • Data Dictionary
          • ElasticSearch
          • Redis
        • APIs
        • Flink Jobs
          • Merge User Courses
          • Relation Cache Updater
          • Activity Aggregate Updater
          • Assessment Aggregator
          • Enrolment Reconciliation
          • Collection Certificate Pre-Processor
          • Collection Certificate Generator
        • Reports
          • On-Demand Exhaust
            • Response Exhaust
            • User Info Exhaust
            • Progress Exhaust
          • Other Jobs
            • Collection Summary Job
            • Course Batch Status Updater Job
            • Cassandra Migrator Job
            • Score Metric Migration Job
            • Assessment Score Correction Job
            • Collection Reconciliation Job
            • Course Enrollment Job
            • Course Consumption Job
        • Logs, Telemetry Events
        • Configuration
          • System Configuration
          • Functional Configuration
        • Dependencies
        • Certificate Registry and Credentialing using Sunbird-RC
          • Configuring PublicKey in Sunbird-RC
          • Server Setup guide for Sunbird-RC
          • API Guide For Sunbird-RC
        • Certificate Flow
          • Certificates Creation and Configuration
        • FAQs
      • GROUPS
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
          • Redis
        • APIs
          • Create Group
        • Logs, Telemetry Events
          • UI Telemetry Events
          • Service Telemetry Events
        • Configuration
          • Functional Configurations
        • Design References
        • Dependencies
        • Unit Tests and Code Coverage
      • NOTIFICATION SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Data Dictionary
        • APIs
        • Flink Jobs
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
        • Dependencies
        • Unit Tests and Code Coverage
      • DISCUSSION FORUM
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
            • Nodebb setup
            • Discussion Middleware Setup
            • Discussion Middleware
            • Discussion forum integration with any application
            • Discussion-UI setup along with demo application.
            • Sunbird-lern portal for DF
          • Source Code
        • APIs
          • Category APIs
          • User APIs
          • Post APIs
          • Topic APIs
          • Forum APIs
        • Context Schema
        • Configurations
          • Nodebb Admin panel settings
          • Discussion MW & Nodebb System Config
        • Telemetry Events
        • Dependencies
      • ML SERVICE
        • DATA PIPELINE (Flink Jobs)
          • Program User Info
            • Component Diagram
            • Data Model
            • Folder Structure
          • Ml User Delete
            • Component Diagram
            • Data Model
            • Folder Structure
        • DATA PRODUCTS
          • Program Exhaust
            • Component Diagram
            • Folder Structure
    • Server Installation
    • Dependency setup
    • Deprecation
      • Release-5.4.0
    • Jenkins Jobs
    • Release Calendar
    • Learn More
      • Tech References
      • Telemetry Processing
      • Data Dictionary
        • Sample Data
      • Delete User Functionality
      • Asset Ownership Transfer
    • FAQs
  • Engage
    • Discuss
    • Contribute to Sunbird Lern
    • Raise an Issue
    • Contribution Guidelines
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. USE
  2. Developer Guide
  3. DISCUSSION FORUM
  4. APIs

Topic APIs

PreviousPost APIsNextForum APIs

Last updated 2 years ago

Was this helpful?

Get unread topics

get

This api allow the user to get all the unread topics in nodebb

  • The endpoint for Topics is /unread
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/unread
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/unread HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "template": {},
  "pagination": {},
  "_header": {},
  "nextStart": 0,
  "selectedTerm": {},
  "title": "title",
  "widgets": {},
  "showSelect": true,
  "canPost": true,
  "selectedCids": [
    "selectedCids",
    "selectedCids"
  ],
  "terms": [
    {},
    {}
  ],
  "bodyClass": "bodyClass",
  "topicCount": 6,
  "rssFeedUrl": "rssFeedUrl",
  "categories": [
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    },
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    }
  ],
  "showTopicTools": true,
  "topics": [
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    },
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    }
  ],
  "filters": [
    {},
    {}
  ],
  "allCategoriesUrl": "allCategoriesUrl",
  "url": "url",
  "selectedFilter": {},
  "tids": [
    "tids",
    "tids"
  ],
  "feeds:disableRSS": 9,
  "loggedIn": true,
  "selectedCategory": {},
  "relative_path": "relative_path",
  "breadcrumbs": [
    {},
    {}
  ]
}

Get recent topics

get

This api allow the user to get all the recent topics in nodebb

  • The endpoint for Topics is /recent
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/recent
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/recent HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "template": {},
  "pagination": {},
  "_header": {},
  "nextStart": 0,
  "selectedTerm": {},
  "title": "title",
  "widgets": {},
  "showSelect": true,
  "canPost": true,
  "selectedCids": [
    "selectedCids",
    "selectedCids"
  ],
  "terms": [
    {},
    {}
  ],
  "bodyClass": "bodyClass",
  "topicCount": 6,
  "rssFeedUrl": "rssFeedUrl",
  "categories": [
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    },
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    }
  ],
  "showTopicTools": true,
  "topics": [
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    },
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    }
  ],
  "filters": [
    {},
    {}
  ],
  "allCategoriesUrl": "allCategoriesUrl",
  "url": "url",
  "selectedFilter": {},
  "tids": [
    "tids",
    "tids"
  ],
  "feeds:disableRSS": 9,
  "loggedIn": true,
  "selectedCategory": {},
  "relative_path": "relative_path",
  "breadcrumbs": [
    {},
    {}
  ]
}

Get popular topics

get

This api allow the user to get all the popular topics in nodebb

  • The endpoint for Topics is /recent
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/popular
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/popular HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "template": {},
  "pagination": {},
  "_header": {},
  "nextStart": 0,
  "selectedTerm": {},
  "title": "title",
  "widgets": {},
  "showSelect": true,
  "canPost": true,
  "selectedCids": [
    "selectedCids",
    "selectedCids"
  ],
  "terms": [
    {},
    {}
  ],
  "bodyClass": "bodyClass",
  "topicCount": 6,
  "rssFeedUrl": "rssFeedUrl",
  "categories": [
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    },
    {
      "parentCid": 5,
      "color": "color",
      "bgColor": "bgColor",
      "level": "level",
      "name": "name",
      "icon": "icon",
      "selected": true,
      "cid": 4,
      "imageClass": "imageClass"
    }
  ],
  "showTopicTools": true,
  "topics": [
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    },
    {
      "pinned": 1,
      "lastposttime": 5,
      "upvotes": 1,
      "unreplied": true,
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 7,
      "uid": 3,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 6,
      "isOwner": true,
      "mainPid": 5,
      "locked": 7,
      "slug": "slug",
      "timestamp": 9,
      "ignored": true,
      "index": 1,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 4,
      "postcount": 2,
      "viewcount": 2,
      "titleRaw": "titleRaw",
      "votes": 7,
      "category": {
        "parentCid": 6,
        "bgColor": "bgColor",
        "color": "color",
        "backgroundImage": {},
        "name": "name",
        "icon": "icon",
        "slug": "slug",
        "cid": 2,
        "imageClass": "imageClass"
      },
      "user": {
        "uid": 6,
        "icon:bgColor": "icon:bgColor",
        "icon:text": "icon:text",
        "userslug": "userslug",
        "picture": {},
        "username": "username",
        "status": "status"
      },
      "cid": 1,
      "teaser": {}
    }
  ],
  "filters": [
    {},
    {}
  ],
  "allCategoriesUrl": "allCategoriesUrl",
  "url": "url",
  "selectedFilter": {},
  "tids": [
    "tids",
    "tids"
  ],
  "feeds:disableRSS": 9,
  "loggedIn": true,
  "selectedCategory": {},
  "relative_path": "relative_path",
  "breadcrumbs": [
    {},
    {}
  ]
}

Get teaser of topic

get

This api allow the user to get teaser details of topic in nodebb

  • The endpoint for Topics is /topic/teaser/{topic_id}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/topic/teaser/{topic_id}
Path parameters
topic_idintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/topic/teaser/{topic_id} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "pid": 16,
  "tid": 16,
  "content": "<p dir=\"auto\">Disucssion umesh 1</p>",
  "uid": 4,
  "timestamp": 1610103898937,
  "deleted": false,
  "upvotes": 0,
  "downvotes": 0,
  "replies": 0,
  "votes": 0,
  "timestampISO": "2021-01-08T11:04:58.937Z",
  "user": {
    "uid": 4,
    "username": "nodebb",
    "userslug": "nodebb",
    "picture": null,
    "status": "offline",
    "displayname": "nodebb",
    "icon:text": "N",
    "icon:bgColor": null
  },
  "topic": {
    "uid": 4,
    "tid": 16,
    "title": "Disucssion umesh 1",
    "cid": 8,
    "slug": "16/disucssion-umesh-1",
    "deleted": 0,
    "postcount": 1,
    "mainPid": 16,
    "teaserPid": null,
    "titleRaw": "Disucssion umesh 1"
  },
  "category": {
    "cid": 8,
    "name": "Announcements",
    "icon": "fa-comments",
    "slug": "8/announcements",
    "parentCid": 7,
    "bgColor": null,
    "color": null,
    "backgroundImage": null,
    "imageClass": "cover"
  },
  "isMainPost": true
}

Get topics details

get

This api allow the user to get topics details by using topicId ad slug from nodebb

  • The endpoint for Topics is /topic/{topic_id}/{slug}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/topic/{topic_id}/{slug}
Path parameters
topic_idintegerRequired
slugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/topic/{topic_id}/{slug} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "privileges": {},
  "upvotes": 7,
  "unreplied": true,
  "privateUploads": true,
  "postDeleteDuration": 6,
  "_header": {},
  "topicStaleDays": 4,
  "teaserPid": 6,
  "loggedInUser": {},
  "posts": [
    {},
    {}
  ],
  "tid": 5,
  "postEditDuration": 9,
  "deleterUid": 1,
  "necroThreshold": 8,
  "mainPid": 1,
  "rssFeedUrl": "rssFeedUrl",
  "locked": 2,
  "slug": "slug",
  "reputation:disabled": 5,
  "downvotes": 1,
  "tags": [
    "tags",
    "tags"
  ],
  "bookmark": {},
  "feeds:disableRSS": 9,
  "isNotFollowing": true,
  "loggedIn": true,
  "downvote:disabled": 9,
  "postIndex": 3,
  "titleRaw": "titleRaw",
  "relative_path": "relative_path",
  "breadcrumbs": [
    {},
    {}
  ],
  "cid": 0,
  "allowMultipleBadges": true,
  "template": {},
  "pinned": 4,
  "pagination": {},
  "lastposttime": 6,
  "bookmarkThreshold": 6,
  "postSharing": [
    {},
    {}
  ],
  "timestampISO": "timestampISO",
  "title": "title",
  "widgets": {},
  "deleter": {},
  "uid": 7,
  "lastposttimeISO": "lastposttimeISO",
  "maxTags": 1,
  "related": [
    {},
    {}
  ],
  "bodyClass": "bodyClass",
  "tagWhitelist": [
    "tagWhitelist",
    "tagWhitelist"
  ],
  "timestamp": 2,
  "minTags": 7,
  "isIgnoring": true,
  "isFollowing": true,
  "scrollToMyPost": true,
  "icons": [
    {},
    {}
  ],
  "url": "url",
  "deleted": 3,
  "postcount": 5,
  "thread_tools": [
    "thread_tools",
    "thread_tools"
  ],
  "viewcount": 9,
  "votes": 1,
  "category": [
    {},
    {}
  ],
  "merger": {}
}

Delete a topic (Soft delete)

put

This api allow the user to delete a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/state
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/state
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/topics/{tid}/state HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {}
}

Follow a topic

put

This api allow the user to follow a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/state
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/follow
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/topics/{tid}/follow HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {}
}

UnFollow a Post

delete

This api allow the user to unfollow a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/state
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/follow
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
delete
DELETE /api/discussion/v2/topics/{tid}/follow HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {}
}

Delete tags for a topic

delete

This api allow the user to delete tags for a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/tags
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/tags
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
delete
DELETE /api/discussion/v2/topics/{tid}/tags HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {}
}

Unpin a topic

delete

This api allow the user to unpin a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/pin
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/pin
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
delete
DELETE /api/discussion/v2/topics/{tid}/pin HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {}
}

delete topic

delete

This api allow the user to delete topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
delete
DELETE /api/discussion/v2/topics/{tid} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "code": "code",
  "payload": {
    "topicData": {
      "pinned": 4,
      "lastposttime": 6,
      "upvotes": 7,
      "unreplied": 6,
      "mainPost": {},
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 5,
      "uid": 7,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 1,
      "isOwner": true,
      "mainPid": 1,
      "locked": 2,
      "slug": "slug",
      "timestamp": 2,
      "ignored": true,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 3,
      "postcount": 5,
      "viewcount": 9,
      "titleRaw": "titleRaw",
      "votes": 1,
      "category": {},
      "user": {},
      "cid": 0,
      "teaser": {}
    },
    "postData": {
      "isMain": true,
      "bookmarked": true,
      "selfPost": true,
      "index": 9,
      "pid": 7,
      "timestampISO": "timestampISO",
      "display_edit_tools": true,
      "tid": 4,
      "content": "content",
      "uid": 1,
      "display_moderator_tools": true,
      "display_move_tools": true,
      "topic": {},
      "votes": 6,
      "display_delete_tools": true,
      "user": {},
      "timestamp": 5,
      "cid": 9
    }
  }
}
  • GETGet unread topics
  • GETGet recent topics
  • GETGet popular topics
  • GETGet teaser of topic
  • GETGet topics details
  • POSTCreate new topic
  • PUTDelete a topic (Soft delete)
  • PUTFollow a topic
  • DELETEUnFollow a Post
  • PUTAdd tags for a topic
  • DELETEDelete tags for a topic
  • PUTPin a topic
  • DELETEUnpin a topic
  • PUTUpdates topic details
  • POSTCreate new reply to topic
  • DELETEdelete topic

Create new topic

post

This api allow the user to create new topic in nodebb

  • The endpoint for Topics is /v2/topics
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics
Header parameters
AuthorizationstringRequired
Body
cidintegerRequired
titlestringRequired
contentstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
post
POST /api/discussion/v2/topics HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "cid": 1,
  "title": "Learning",
  "content": "All Javascript frameworks"
}
{
  "code": "code",
  "payload": {
    "topicData": {
      "pinned": 4,
      "lastposttime": 6,
      "upvotes": 7,
      "unreplied": 6,
      "mainPost": {},
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 5,
      "uid": 7,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 1,
      "isOwner": true,
      "mainPid": 1,
      "locked": 2,
      "slug": "slug",
      "timestamp": 2,
      "ignored": true,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 3,
      "postcount": 5,
      "viewcount": 9,
      "titleRaw": "titleRaw",
      "votes": 1,
      "category": {},
      "user": {},
      "cid": 0,
      "teaser": {}
    },
    "postData": {
      "isMain": true,
      "bookmarked": true,
      "selfPost": true,
      "index": 9,
      "pid": 7,
      "timestampISO": "timestampISO",
      "display_edit_tools": true,
      "tid": 4,
      "content": "content",
      "uid": 1,
      "display_moderator_tools": true,
      "display_move_tools": true,
      "topic": {},
      "votes": 6,
      "display_delete_tools": true,
      "user": {},
      "timestamp": 5,
      "cid": 9
    }
  }
}

Add tags for a topic

put

This api allow the user to add tags to a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/tags
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/tags
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Body
string[]Optional
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/topics/{tid}/tags HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "code": "code",
  "payload": {}
}

Pin a topic

put

This api allow the user to pin to a topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}/pin
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}/pin
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Body
string[]Optional
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/topics/{tid}/pin HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "code": "code",
  "payload": {}
}

Updates topic details

put

This api allow the user to update topic details in nodebb

  • The endpoint for Topics is /v2/topics/{tid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Body
pidintegerRequired
contentstringRequired
handlestringOptional
titlestringOptional
topic_thumbintegerOptional
tagsstring[]Optional
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/topics/{tid} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 113

{
  "content": "Example content",
  "pid": 1,
  "handle": "example",
  "title": "Topic title",
  "topic_thumb": 0,
  "tags": [
    "Angular"
  ]
}
{
  "code": "code",
  "payload": {
    "topicData": {
      "pinned": 4,
      "lastposttime": 6,
      "upvotes": 7,
      "unreplied": 6,
      "mainPost": {},
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 5,
      "uid": 7,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 1,
      "isOwner": true,
      "mainPid": 1,
      "locked": 2,
      "slug": "slug",
      "timestamp": 2,
      "ignored": true,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 3,
      "postcount": 5,
      "viewcount": 9,
      "titleRaw": "titleRaw",
      "votes": 1,
      "category": {},
      "user": {},
      "cid": 0,
      "teaser": {}
    },
    "postData": {
      "isMain": true,
      "bookmarked": true,
      "selfPost": true,
      "index": 9,
      "pid": 7,
      "timestampISO": "timestampISO",
      "display_edit_tools": true,
      "tid": 4,
      "content": "content",
      "uid": 1,
      "display_moderator_tools": true,
      "display_move_tools": true,
      "topic": {},
      "votes": 6,
      "display_delete_tools": true,
      "user": {},
      "timestamp": 5,
      "cid": 9
    }
  }
}

Create new reply to topic

post

This api allow the user to create new reply to topic in nodebb

  • The endpoint for Topics is /v2/topics/{tid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/topics/{tid}
Path parameters
tidintegerRequired
Header parameters
AuthorizationstringRequired
Body
contentstringRequired
toPidintegerOptional
Responses
200
successful operation
application/json
400
Bad request
application/json
post
POST /api/discussion/v2/topics/{tid} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "content": "Example reply to topic",
  "toPid": 1
}
{
  "code": "code",
  "payload": {
    "topicData": {
      "pinned": 4,
      "lastposttime": 6,
      "upvotes": 7,
      "unreplied": 6,
      "mainPost": {},
      "unread": true,
      "timestampISO": "timestampISO",
      "title": "title",
      "teaserPid": {},
      "tid": 5,
      "uid": 7,
      "lastposttimeISO": "lastposttimeISO",
      "deleterUid": 1,
      "isOwner": true,
      "mainPid": 1,
      "locked": 2,
      "slug": "slug",
      "timestamp": 2,
      "ignored": true,
      "downvotes": 1,
      "icons": {},
      "tags": {},
      "bookmark": {},
      "deleted": 3,
      "postcount": 5,
      "viewcount": 9,
      "titleRaw": "titleRaw",
      "votes": 1,
      "category": {},
      "user": {},
      "cid": 0,
      "teaser": {}
    },
    "postData": {
      "isMain": true,
      "bookmarked": true,
      "selfPost": true,
      "index": 9,
      "pid": 7,
      "timestampISO": "timestampISO",
      "display_edit_tools": true,
      "tid": 4,
      "content": "content",
      "uid": 1,
      "display_moderator_tools": true,
      "display_move_tools": true,
      "topic": {},
      "votes": 6,
      "display_delete_tools": true,
      "user": {},
      "timestamp": 5,
      "cid": 9
    }
  }
}