Get logged in user profile and posts
This API endpoint allows retrieving the profile details of a logged in user, user's posts, pages, followers count etc.
The tab
parameter is used in the API to allow users to customize their results. By passing different values to tab in the API endpoint, users can fetch posts that meet specific criteria, such as the most popular or latest posts, or posts created by a specific user. Following table explain the tab value and expected results.
For some tab
value, user need to be logged in otherwise system will return an empty array.
tab value | Explanation | Required user login |
---|---|---|
newest | recent posts at top | No |
following | return reflections of authors that current user is following | Yes |
draft | returns current user's private notes | Yes |
favorite | returns current user's favorite posts | Yes |
most_popular | default tab value. Return most popular posts | No |
Path Parameters
username of user
Query Parameters
Client API token
Possible values: [draft
, following
, favorite
, newest
, most_popular
]
Header Parameters
user access token
client token
timestamp of token expiry date
Default value: Bearer
access token type
user uid
- 200
- 401
- 404
- 500
User profile, notification and other settings and recent posts
Schema
- Array [
- ]
- Array [
- Array [
- ]
- Array [
- ]
- Array [
- ]
- ]
user_info object
user_notifications_settings object[]
posts object
posts object[]
The ID of the post.
the post text
The number of likes.
Whether the post should be publicly viewed or not.
The date the post was published at. Format of the date is MMMM dd, yyyy HH:mm
Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.
Whether the post is editable or not. It will be true
if the post belongs to the current user.
Whether the post is deletable or not. It will be true
if the post belongs to the current user.
Whether the current user can report the post or not.
citation_texts object[]
translation text
name of the translation
from ayah number
to ayah number
The language of the post.
The number of views.
author object
filters object[]
tags object[]
the #tag
Default value: 0
The average time it takes to read the post
{
"success": true,
"user_info": {
"id": 0,
"username": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"verified": true,
"followed": true,
"rooms_list": [
"string"
],
"display_name": "string",
"user_type": "string",
"user_notifications_settings": [
{
"id": 0,
"emails_disabled": true,
"follow_notification": true,
"followed_user_added_post_notification": true,
"post_commented_notification": true,
"post_liked_notification": true,
"mention_notification": true,
"added_post_in_group_notification": true,
"follow_push_notification": true,
"followed_user_added_post_push_notification": true,
"post_commented_push_notification": true,
"post_liked_push_notification": true,
"mention_push_notification": true,
"added_post_in_group_push_notification": true
}
]
},
"posts_count": 0,
"followers": 0,
"followees": 0,
"posts": {
"posts": [
{
"id": 0,
"body": "string",
"likes": 0,
"draft": true,
"published_at": "string",
"global": true,
"editable": true,
"deletable": true,
"reportable": true,
"citation_texts": [
{
"id": 0,
"text": "string",
"translated_name": "string",
"from": 0,
"to": 0,
"translation_id": 0
}
],
"language": "string",
"detected_translation": 0,
"views": 0,
"comments": [
{}
],
"liked": true,
"author": {
"id": 0,
"username": "string",
"name": "string",
"verified": true,
"profile_img": "string"
},
"filters": [
{
"id": 0,
"from": 0,
"to": 0,
"indicator_text": "string"
}
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"estimated_reading_time": 55018.9
}
]
},
"pages": 0
}
{
"success": true,
"user_info": {
"id": 0,
"username": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"verified": true,
"profile_img": null,
"followed": true,
"original_profile_img": null,
"rooms_list": [
"string"
],
"display_name": "string",
"user_type": "string",
"user_notifications_settings": [
{
"id": 0,
"emails_disabled": true,
"follow_notification": true,
"followed_user_added_post_notification": true,
"post_commented_notification": true,
"post_liked_notification": true,
"mention_notification": true,
"added_post_in_group_notification": true,
"follow_push_notification": true,
"followed_user_added_post_push_notification": true,
"post_commented_push_notification": true,
"post_liked_push_notification": true,
"mention_push_notification": true,
"added_post_in_group_push_notification": true
}
]
},
"posts_count": 0,
"followers": 0,
"followees": 0,
"posts": {
"posts": [
{
"id": 0,
"body": "string",
"likes": 0,
"draft": true,
"published_at": "string",
"room_id": null,
"global": true,
"editable": true,
"deletable": true,
"reportable": true,
"citation_texts": [
{
"id": 0,
"text": "string",
"translated_name": "string",
"from": 0,
"to": 0,
"translation_id": 0
}
],
"language": "string",
"detected_translation": 0,
"views": 0,
"group": null,
"group_link": null,
"comments": [
{}
],
"liked": true,
"author": {
"id": 0,
"username": "string",
"name": "string",
"verified": true,
"profile_img": "string"
},
"filters": [
{
"id": 0,
"from": 0,
"to": 0,
"indicator_text": "string"
}
],
"tags": [
{
"id": 0,
"name": "string"
}
]
}
]
},
"pages": 1
}
Unauthorized response, api will respond with this 401 eithr user is not logged in or do not have permission to perform some action. Like creating a post in a room, but user is not member of room.
System will also return 401 if api token is missing or invlaid.
Schema
Default value: 401
Default value: false
{
"errors": [
"string"
],
"status": 401,
"success": false
}
{
"errors": [
"You need to sign in or sign up before continuing."
],
"success": false
}
{
"message": "You don't have permission!",
"status": 401,
"success": false
}
User not found with given username
Schema
{
"success": true,
"message": "string"
}
{
"success": false,
"message": "Invalid User"
}
Internal server error, api will respond with 500 if something went wrong processing the request.
Schema
Default value: false
Default value: internal server error
error message
{
"success": false,
"message": "internal server error"
}