📙
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

User APIs

PreviousCategory APIsNextPost APIs

Last updated 1 year ago

Was this helpful?

Fetch nodebb user details

get

This api is used for fetching the user details based on user slug from nodebb.

  • The endpoint for User is /user/{userslug}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/{userslug}
Path parameters
userslugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/{userslug} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "websiteLink": "websiteLink",
  "_header": {},
  "reputation": 5,
  "blocksCount": true,
  "posts": [
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    },
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    }
  ],
  "sso": [
    {},
    {}
  ],
  "icon:text": "icon:text",
  "isGlobalModerator": true,
  "joindate": 0,
  "profile_links": [
    {},
    {}
  ],
  "reputation:disabled": true,
  "banned_until_readable": "banned_until_readable",
  "allowCoverPicture": true,
  "isAdmin": true,
  "moderationNote": "moderationNote",
  "ips": {},
  "latestPosts": [
    null,
    null
  ],
  "aboutme": "aboutme",
  "email:confirmed": true,
  "isTargetAdmin": true,
  "isAdminOrGlobalModerator": true,
  "emailClass": "emailClass",
  "loggedIn": true,
  "downvote:disabled": true,
  "topiccount": 2,
  "relative_path": "relative_path",
  "isSelf": true,
  "breadcrumbs": [
    {},
    {}
  ],
  "status": "status",
  "birthday": "birthday",
  "template": {},
  "showHidden": true,
  "yourid": 1,
  "lastposttime": 7,
  "isModerator": true,
  "signature": "signature",
  "icon:bgColor": true,
  "canEdit": true,
  "flags": "flags",
  "groupTitle": "groupTitle",
  "isBlocked": true,
  "bestPosts": [
    null,
    null
  ],
  "title": "title",
  "widgets": {},
  "followingCount": 2,
  "lastonlineISO": "lastonlineISO",
  "email:disableEdit": true,
  "uid": "uid",
  "groupTitleArray": [
    "groupTitleArray",
    "groupTitleArray"
  ],
  "canChangePassword": true,
  "profileviews": 1,
  "bodyClass": "bodyClass",
  "cover:url": "cover:url",
  "selectedGroup": [
    {},
    {}
  ],
  "banned": true,
  "banned_until": 4,
  "userslug": "userslug",
  "followerCount": 3,
  "email": "email",
  "website": "website",
  "isFollowing": true,
  "uploadedpicture": "uploadedpicture",
  "canBan": true,
  "lastonline": 6,
  "disableSignatures": true,
  "banned:expire": 9,
  "groups": [
    {},
    {}
  ],
  "username:disableEdit": true,
  "joindateISO": "joindateISO",
  "url": "url",
  "isSelfOrAdminOrGlobalModerator": true,
  "websiteName": "websiteName",
  "hasPrivateChat": 1,
  "isAdminOrGlobalModeratorOrModerator": true,
  "cover:position": "cover:position",
  "postcount": 5,
  "location": "location",
  "fullname": "fullname",
  "aboutmeParsed": "aboutmeParsed",
  "age": 7,
  "theirid": 1,
  "username": "username"
}

Fetch nodebb user details by using uid

get

This api is used for fetching the user details based on nodebb uid.

  • The endpoint for User is /user/uid/{uid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/uid/{uid}
Path parameters
uidstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/uid/{uid} HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "uid": 1,
  "username": "text",
  "userslug": "text",
  "email:confirmed": 1,
  "joindate": 1,
  "lastonline": 1,
  "picture": {},
  "location": {},
  "birthday": {},
  "website": {},
  "aboutme": {},
  "signature": {},
  "uploadedpicture": {},
  "profileviews": 1,
  "reputation": 1,
  "postcount": 1,
  "topiccount": 1,
  "lastposttime": 1,
  "banned": 1,
  "banned:expire": 1,
  "status": "text",
  "flags": {},
  "followerCount": 1,
  "followingCount": 1,
  "cover:url": {},
  "cover:position": {},
  "groupTitle": {},
  "sunbird-oidcId": {},
  "displayname": "text",
  "groupTitleArray": {},
  "icon:text": "text",
  "icon:bgColor": "text",
  "joindateISO": "text",
  "lastonlineISO": "text",
  "banned_until": 1,
  "banned_until_readable": "text"
}

Fetch user upvoted posts list

get

This api is used for fetching the user upvote details from nodebb.

  • The endpoint for User is /user/{userslug}/upvoted
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/{userslug}/upvoted
Path parameters
userslugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/{userslug}/upvoted HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "websiteLink": "websiteLink",
  "_header": {},
  "reputation": 5,
  "blocksCount": true,
  "posts": [
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    },
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    }
  ],
  "sso": [
    {},
    {}
  ],
  "icon:text": "icon:text",
  "isGlobalModerator": true,
  "joindate": 0,
  "profile_links": [
    {},
    {}
  ],
  "reputation:disabled": true,
  "banned_until_readable": "banned_until_readable",
  "allowCoverPicture": true,
  "isAdmin": true,
  "moderationNote": "moderationNote",
  "ips": {},
  "latestPosts": [
    null,
    null
  ],
  "aboutme": "aboutme",
  "email:confirmed": true,
  "isTargetAdmin": true,
  "isAdminOrGlobalModerator": true,
  "emailClass": "emailClass",
  "loggedIn": true,
  "downvote:disabled": true,
  "topiccount": 2,
  "relative_path": "relative_path",
  "isSelf": true,
  "breadcrumbs": [
    {},
    {}
  ],
  "status": "status",
  "birthday": "birthday",
  "template": {},
  "showHidden": true,
  "yourid": 1,
  "lastposttime": 7,
  "isModerator": true,
  "signature": "signature",
  "icon:bgColor": true,
  "canEdit": true,
  "flags": "flags",
  "groupTitle": "groupTitle",
  "isBlocked": true,
  "bestPosts": [
    null,
    null
  ],
  "title": "title",
  "widgets": {},
  "followingCount": 2,
  "lastonlineISO": "lastonlineISO",
  "email:disableEdit": true,
  "uid": "uid",
  "groupTitleArray": [
    "groupTitleArray",
    "groupTitleArray"
  ],
  "canChangePassword": true,
  "profileviews": 1,
  "bodyClass": "bodyClass",
  "cover:url": "cover:url",
  "selectedGroup": [
    {},
    {}
  ],
  "banned": true,
  "banned_until": 4,
  "userslug": "userslug",
  "followerCount": 3,
  "email": "email",
  "website": "website",
  "isFollowing": true,
  "uploadedpicture": "uploadedpicture",
  "canBan": true,
  "lastonline": 6,
  "disableSignatures": true,
  "banned:expire": 9,
  "groups": [
    {},
    {}
  ],
  "username:disableEdit": true,
  "joindateISO": "joindateISO",
  "url": "url",
  "isSelfOrAdminOrGlobalModerator": true,
  "websiteName": "websiteName",
  "hasPrivateChat": 1,
  "isAdminOrGlobalModeratorOrModerator": true,
  "cover:position": "cover:position",
  "postcount": 5,
  "location": "location",
  "fullname": "fullname",
  "aboutmeParsed": "aboutmeParsed",
  "age": 7,
  "theirid": 1,
  "username": "username"
}

Fetch user downvoted posts list

get

This api is used for fetching the user down vote details from nodebb.

  • The endpoint for User is /user/{userslug}/downvoted
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/{userslug}/downvoted
Path parameters
userslugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/{userslug}/downvoted HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "websiteLink": "websiteLink",
  "_header": {},
  "reputation": 5,
  "blocksCount": true,
  "posts": [
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    },
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    }
  ],
  "sso": [
    {},
    {}
  ],
  "icon:text": "icon:text",
  "isGlobalModerator": true,
  "joindate": 0,
  "profile_links": [
    {},
    {}
  ],
  "reputation:disabled": true,
  "banned_until_readable": "banned_until_readable",
  "allowCoverPicture": true,
  "isAdmin": true,
  "moderationNote": "moderationNote",
  "ips": {},
  "latestPosts": [
    null,
    null
  ],
  "aboutme": "aboutme",
  "email:confirmed": true,
  "isTargetAdmin": true,
  "isAdminOrGlobalModerator": true,
  "emailClass": "emailClass",
  "loggedIn": true,
  "downvote:disabled": true,
  "topiccount": 2,
  "relative_path": "relative_path",
  "isSelf": true,
  "breadcrumbs": [
    {},
    {}
  ],
  "status": "status",
  "birthday": "birthday",
  "template": {},
  "showHidden": true,
  "yourid": 1,
  "lastposttime": 7,
  "isModerator": true,
  "signature": "signature",
  "icon:bgColor": true,
  "canEdit": true,
  "flags": "flags",
  "groupTitle": "groupTitle",
  "isBlocked": true,
  "bestPosts": [
    null,
    null
  ],
  "title": "title",
  "widgets": {},
  "followingCount": 2,
  "lastonlineISO": "lastonlineISO",
  "email:disableEdit": true,
  "uid": "uid",
  "groupTitleArray": [
    "groupTitleArray",
    "groupTitleArray"
  ],
  "canChangePassword": true,
  "profileviews": 1,
  "bodyClass": "bodyClass",
  "cover:url": "cover:url",
  "selectedGroup": [
    {},
    {}
  ],
  "banned": true,
  "banned_until": 4,
  "userslug": "userslug",
  "followerCount": 3,
  "email": "email",
  "website": "website",
  "isFollowing": true,
  "uploadedpicture": "uploadedpicture",
  "canBan": true,
  "lastonline": 6,
  "disableSignatures": true,
  "banned:expire": 9,
  "groups": [
    {},
    {}
  ],
  "username:disableEdit": true,
  "joindateISO": "joindateISO",
  "url": "url",
  "isSelfOrAdminOrGlobalModerator": true,
  "websiteName": "websiteName",
  "hasPrivateChat": 1,
  "isAdminOrGlobalModeratorOrModerator": true,
  "cover:position": "cover:position",
  "postcount": 5,
  "location": "location",
  "fullname": "fullname",
  "aboutmeParsed": "aboutmeParsed",
  "age": 7,
  "theirid": 1,
  "username": "username"
}

Fetch user bookmarked posts

get

This api is used for fetching the user bookmark post details from nodebb.

  • The endpoint for User is /user/{userslug}/bookmarks
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/{userslug}/bookmarks
Path parameters
userslugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/{userslug}/bookmarks HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "websiteLink": "websiteLink",
  "_header": {},
  "reputation": 5,
  "blocksCount": true,
  "posts": [
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    },
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    }
  ],
  "sso": [
    {},
    {}
  ],
  "icon:text": "icon:text",
  "isGlobalModerator": true,
  "joindate": 0,
  "profile_links": [
    {},
    {}
  ],
  "reputation:disabled": true,
  "banned_until_readable": "banned_until_readable",
  "allowCoverPicture": true,
  "isAdmin": true,
  "moderationNote": "moderationNote",
  "ips": {},
  "latestPosts": [
    null,
    null
  ],
  "aboutme": "aboutme",
  "email:confirmed": true,
  "isTargetAdmin": true,
  "isAdminOrGlobalModerator": true,
  "emailClass": "emailClass",
  "loggedIn": true,
  "downvote:disabled": true,
  "topiccount": 2,
  "relative_path": "relative_path",
  "isSelf": true,
  "breadcrumbs": [
    {},
    {}
  ],
  "status": "status",
  "birthday": "birthday",
  "template": {},
  "showHidden": true,
  "yourid": 1,
  "lastposttime": 7,
  "isModerator": true,
  "signature": "signature",
  "icon:bgColor": true,
  "canEdit": true,
  "flags": "flags",
  "groupTitle": "groupTitle",
  "isBlocked": true,
  "bestPosts": [
    null,
    null
  ],
  "title": "title",
  "widgets": {},
  "followingCount": 2,
  "lastonlineISO": "lastonlineISO",
  "email:disableEdit": true,
  "uid": "uid",
  "groupTitleArray": [
    "groupTitleArray",
    "groupTitleArray"
  ],
  "canChangePassword": true,
  "profileviews": 1,
  "bodyClass": "bodyClass",
  "cover:url": "cover:url",
  "selectedGroup": [
    {},
    {}
  ],
  "banned": true,
  "banned_until": 4,
  "userslug": "userslug",
  "followerCount": 3,
  "email": "email",
  "website": "website",
  "isFollowing": true,
  "uploadedpicture": "uploadedpicture",
  "canBan": true,
  "lastonline": 6,
  "disableSignatures": true,
  "banned:expire": 9,
  "groups": [
    {},
    {}
  ],
  "username:disableEdit": true,
  "joindateISO": "joindateISO",
  "url": "url",
  "isSelfOrAdminOrGlobalModerator": true,
  "websiteName": "websiteName",
  "hasPrivateChat": 1,
  "isAdminOrGlobalModeratorOrModerator": true,
  "cover:position": "cover:position",
  "postcount": 5,
  "location": "location",
  "fullname": "fullname",
  "aboutmeParsed": "aboutmeParsed",
  "age": 7,
  "theirid": 1,
  "username": "username"
}

Fetch user recent posts

get

This api is used for fetching the user recent post details from nodebb.

  • The endpoint for User is /user/{userslug}/posts
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/{userslug}/posts
Path parameters
userslugstringRequired
Header parameters
AuthorizationstringRequired
Responses
200
successful operation
application/json
400
Bad request
application/json
get
GET /api/discussion/user/{userslug}/posts HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Accept: */*
{
  "websiteLink": "websiteLink",
  "_header": {},
  "reputation": 5,
  "blocksCount": true,
  "posts": [
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    },
    {
      "upvotes": 5,
      "pid": 6,
      "timestampISO": "timestampISO",
      "downvotes": 9,
      "tid": 7,
      "content": "content",
      "uid": 1,
      "deleted": true,
      "isMainPost": true,
      "topic": {
        "uid": 8,
        "deleted": 3,
        "postcount": 6,
        "titleRaw": "titleRaw",
        "mainPid": 1,
        "title": "title",
        "teaserPid": {},
        "tid": 9,
        "slug": "slug",
        "cid": 6
      },
      "votes": 9,
      "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"
      },
      "timestamp": 4
    }
  ],
  "sso": [
    {},
    {}
  ],
  "icon:text": "icon:text",
  "isGlobalModerator": true,
  "joindate": 0,
  "profile_links": [
    {},
    {}
  ],
  "reputation:disabled": true,
  "banned_until_readable": "banned_until_readable",
  "allowCoverPicture": true,
  "isAdmin": true,
  "moderationNote": "moderationNote",
  "ips": {},
  "latestPosts": [
    null,
    null
  ],
  "aboutme": "aboutme",
  "email:confirmed": true,
  "isTargetAdmin": true,
  "isAdminOrGlobalModerator": true,
  "emailClass": "emailClass",
  "loggedIn": true,
  "downvote:disabled": true,
  "topiccount": 2,
  "relative_path": "relative_path",
  "isSelf": true,
  "breadcrumbs": [
    {},
    {}
  ],
  "status": "status",
  "birthday": "birthday",
  "template": {},
  "showHidden": true,
  "yourid": 1,
  "lastposttime": 7,
  "isModerator": true,
  "signature": "signature",
  "icon:bgColor": true,
  "canEdit": true,
  "flags": "flags",
  "groupTitle": "groupTitle",
  "isBlocked": true,
  "bestPosts": [
    null,
    null
  ],
  "title": "title",
  "widgets": {},
  "followingCount": 2,
  "lastonlineISO": "lastonlineISO",
  "email:disableEdit": true,
  "uid": "uid",
  "groupTitleArray": [
    "groupTitleArray",
    "groupTitleArray"
  ],
  "canChangePassword": true,
  "profileviews": 1,
  "bodyClass": "bodyClass",
  "cover:url": "cover:url",
  "selectedGroup": [
    {},
    {}
  ],
  "banned": true,
  "banned_until": 4,
  "userslug": "userslug",
  "followerCount": 3,
  "email": "email",
  "website": "website",
  "isFollowing": true,
  "uploadedpicture": "uploadedpicture",
  "canBan": true,
  "lastonline": 6,
  "disableSignatures": true,
  "banned:expire": 9,
  "groups": [
    {},
    {}
  ],
  "username:disableEdit": true,
  "joindateISO": "joindateISO",
  "url": "url",
  "isSelfOrAdminOrGlobalModerator": true,
  "websiteName": "websiteName",
  "hasPrivateChat": 1,
  "isAdminOrGlobalModeratorOrModerator": true,
  "cover:position": "cover:position",
  "postcount": 5,
  "location": "location",
  "fullname": "fullname",
  "aboutmeParsed": "aboutmeParsed",
  "age": 7,
  "theirid": 1,
  "username": "username"
}

Deletes a user from nodebb

delete

This api is used for deleting user in nodebb.

  • The endpoint for User is /v2/users/{uid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/users/{uid}
Path parameters
uidintegerRequired
Header parameters
AuthorizationstringOptional
Responses
200
successful operation
application/json
400
Bad request
application/json
delete
DELETE /api/discussion/v2/users/{uid} HTTP/1.1
Host: staging.sunbirded.org
Accept: */*
{
  "code": "code",
  "payload": {}
}
  • GETFetch nodebb user details
  • GETFetch nodebb user details by using uid
  • GETFetch user upvoted posts list
  • GETFetch user downvoted posts list
  • GETFetch user bookmarked posts
  • GETFetch user recent posts
  • POSTCreate new user in nodebb using write api plugin
  • POSTCreate new user in nodebb Sunbird OIDC
  • PUTUpdates a user's profile information
  • DELETEDeletes a user from nodebb

Create new user in nodebb using write api plugin

post

This api is used for creating the user in nodebb using write api plugin.

  • The endpoint for User is /v2/users
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/users
Header parameters
AuthorizationstringOptional
Body
usernamestringOptional
emailstringOptional
passwordstringOptional
Responses
200
successful operation
application/json
400
Bad request
application/json
post
POST /api/discussion/v2/users HTTP/1.1
Host: staging.sunbirded.org
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "username": "Vinu Kumar",
  "email": "example@gmail.com",
  "password": "Test@123"
}
{
  "code": "code",
  "payload": {
    "uid": 0
  }
}

Create new user in nodebb Sunbird OIDC

post

This api is used for creating the user in nodebb usig Sunbird OIDC plugin.

  • The endpoint for User is /user/v1/create
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/user/v1/create
Header parameters
AuthorizationstringOptional
Body
Responses
200
successful operation
application/json
400
Bad request
application/json
post
POST /api/discussion/user/v1/create HTTP/1.1
Host: staging.sunbirded.org
Content-Type: application/json
Accept: */*
Content-Length: 281

{
  "request": {
    "example": {
      "id": "api.discussions.user.create",
      "ver": 1,
      "params": {
        "resmsgid": null,
        "msgid": null,
        "status": "unsuccessful",
        "msg": "User already Exists"
      },
      "responseCode": 400,
      "result": {
        "userId": {
          "uid": 1
        },
        "userSlug": "content_creator_tn3941",
        "userName": "content_creator_tn3941"
      }
    }
  }
}
{
  "id": "text",
  "ver": "text",
  "params": {
    "resmsgid": "text",
    "msgid": "text",
    "status": "text",
    "msg": "text"
  },
  "responseCode": "text",
  "result": {
    "userId": {
      "uid": 1
    },
    "userSlug": "text",
    "userName": "text"
  }
}

Updates a user's profile information

put

This api is used to update user's profile information in nodebb.

  • The endpoint for User is /v2/users/{uid}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
  • Backend Route: http://nodebb-service:4567/discussions/api/v2/users/{uid}
Path parameters
uidintegerRequired
Header parameters
AuthorizationstringOptional
Body
usernamestringOptional
emailstringOptional
fullnamestringOptional
websitestringOptional
locationstringOptional
birthdaystringOptional
signaturestringOptional
Responses
200
successful operation
application/json
400
Bad request
application/json
put
PUT /api/discussion/v2/users/{uid} HTTP/1.1
Host: staging.sunbirded.org
Content-Type: application/json
Accept: */*
Content-Length: 179

{
  "username": "Venkat",
  "email": "example@gmail.com",
  "fullname": "venkat kadiveti",
  "website": "https://example.org/",
  "location": "Bangalore",
  "birthday": "02/04/1995",
  "signature": "venkat"
}
{
  "code": "code",
  "payload": {}
}