Get posts
Get list of posts.
Query Parameters
Get posts of an exact Ayah only and not of range of Ayahs (the default behavior).
Comma-separated language iso codes, to fetch posts in a specific language(s).
Include posts of scholars
The Ids of the authors of the posts
Include posts of students of knowledge
Include verified posts
Include approved posts
Get posts that are updated after the given date (inclusive).
Further customize the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc.
Possible values: [newest
, following
, draft
, favorite
, most_popular
, only_room_members
, public
, feed
]
Default value: most_popular
newest
= Recent posts will be at the top.
following
= Get posts of authors the current user is following.
draft
= Get current user's private posts.
favorite
= Get current user's favorite posts.
most_popular
= Get most popular posts.
only_room_members
= Get posts that are posted by current room members.
public
= Include public posts of private rooms.
feed
= When passed, this will ignore most passed filters and send verified
posts (if verified
= true
), posts by scholars and student of knowledge, verified posts, posts from author the user is following.
Include only trusted posts and posts by author the user is following.
The current post page. Each page will have 25 posts by default. pages
response field will have the total number of pages.
- 200
- 403
- 404
- 422
- 500
Request has been handled successfully.
Schema
- Array [
- Array [
- ]
- Array [
- ]
- Array [
- ]
- ]
data object
posts object[]
List of posts
The ID of the post.
The body of the post.
The number of likes.
Default value: false
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
The date the post was created at. Format of the date is MMMM dd, yyyy HH:mm
The date the post was last updated. Format of the date is MMMM dd, yyyy HH:mm
author object
Details about the author.
The id of the author of the comment.
The username of the author of the comment.
The first name of the author of the comment.
The first name of the author of the comment.
The display name of the author of the comment.
Whether the comment's author has been verified.
The profile image of the author of the comment. Will be null
if it's empty
Whether the current user is following the author of the comment or not.
The language of the post.
Default value: false
Whether the post was liked by the current user or not.
Default value: false
Whether the post was saved by the current user or not.
Default value: false
Whether the post is verified or not.
Default value: false
Whether the post is hidden or not.
The number of views.
Default value: false
Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.
Default value: false
Whether the post is editable or not. It will be true
if the post belongs to the current user.
Default value: false
Whether the post is deletable or not. It will be true
if the post belongs to the current user.
Default value: false
Whether the current user can report the post or not.
Default value: false
Whether the current user can restore the post after it was deleted or not.
comments object[]
List of comments that belong to the post.
The id of the comment.
The creation date of the comment.
Whether the comment is hidden.
The body of the comment.
The parent comment's id. Will be null
if this comment does not have a parent.
author object
Details about the author.
The id of the author of the comment.
The username of the author of the comment.
The first name of the author of the comment.
The first name of the author of the comment.
The display name of the author of the comment.
Whether the comment's author has been verified.
The profile image of the author of the comment. Will be null
if it's empty
Whether the current user is following the author of the comment or not.
The number of comments the post has. This includes private comments.
The number of public comments the post has.
The Id of the room the post belongs to.
The name of the group the post belongs to. Will be null
it the post does not belong to a group.
The link to the group the post belongs to. Will be null
it the post does not belong to a group.
A social-media sharable title of the post.
references object[]
Possible values: >= 1
and <= 114
The Surah number
Possible values: >= 1
and <= 286
The start of the range of Ayah(s) in a Surah that the post relates to.
If it's a single Ayah,fromAyah
and toAyah
should have the same value.
If the post belongs to the entire Surah, fromAyah
and toAyah
should be left empty
Possible values: >= 1
and <= 286
The end of the range of Ayah(s) in a Surah that the post relates to.
If it's a single Ayah,fromAyah
and toAyah
should have the same value.
If the post belongs to the entire Surah, fromAyah
and toAyah
should be left empty
Default value: false
Whether the post belongs to the entire Surah.
tags object[]
List of tags the post belongs to. If tags
not passed with update post API, existing references of the post will be removed.
The Id of the tag
The name of the tag.
The language of the tag.
Possible values: [as_room
, publicly
, only_members
]
The room post status.
The average number of milliseconds it takes to read the post. It can be 0
if the value could not be estimated.
Number of pages matching the queried posts
{
"success": true,
"data": {
"posts": [
{
"id": 123,
"body": "This is a reflection example!",
"likes": 5,
"isPrivate": false,
"publishedAt": "March 03, 2023 05:45",
"createdAt": "March 03, 2023 05:45",
"lastUpdated": "March 03, 2023 05:45",
"author": {
"id": 135,
"username": "amer",
"firstName": "Amer",
"lastName": "Abbas",
"displayName": "A Abbas",
"verified": true,
"profileImage": "//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/15514/medium.png?1655384045",
"followed": true
},
"language": "ENGLISH",
"liked": false,
"saved": false,
"verified": false,
"hidden": false,
"views": 5,
"global": false,
"editable": false,
"deletable": false,
"reportable": false,
"restorable": false,
"comments": [
{
"id": 135,
"createdAt": "2018-06-27T14:49:10.000Z",
"hidden": false,
"body": "Ma shaa Allah Lahawla walaquwata illa billah",
"parentId": 135,
"author": {
"id": 135,
"username": "amer",
"firstName": "Amer",
"lastName": "Abbas",
"displayName": "A Abbas",
"verified": true,
"profileImage": "//s3.amazonaws.com/qreflect-bucket/events/banner/en/avatars/15514/medium.png?1655384045",
"followed": true
}
}
],
"commentsCount": 5,
"publicCommentsCount": 5,
"roomId": 123,
"group": "Muslim American Society",
"groupLink": "Muslim American Society",
"postTitle": "Osama Sayed's Reflection on Surah Al-Aadiyaat:8",
"references": [
{
"surahId": 2
},
{
"surahId": 5,
"fromAyah": 6,
"toAyah": 8
},
{
"surahId": 114,
"fromAyah": 2,
"toAyah": 2
}
],
"tags": [
{
"id": 1698,
"name": "PodTafseer",
"language": "ENGLISH"
}
],
"roomPostStatus": "as_room",
"estimatedReadingTime": 55018.9
}
],
"pages": 0
}
}
Forbidden error. Can either be due to access token not being passed, having been expired or the caller trying to access a resource without enough permissions.
Schema
error object
{
"success": false,
"error": {
"code": "ForbiddenError",
"message": "Token expired"
}
}
Not Found. The resource being accessed does not exist.
Schema
error object
{
"success": false,
"error": {
"code": "NotFoundError",
"message": "The resource you're looking for does not exist"
}
}
Validation Error. The request includes one or more invalid params. Please check the request params and try again.
Schema
error object
{
"success": false,
"error": {
"code": "ValidationError",
"message": "`id` is required"
}
}
Server Error. Something went wrong, try again later.
Schema
error object
{
"success": false,
"error": {
"code": "ServerError",
"message": "Something went wrong"
}
}