Skip to main content

Get posts‚Äč

This API endpoint allows retrieving the list of reflections/post.

By using different query string, users can fetch posts that meet specific criteria, such as the most popular or latest posts, or posts created by a specific user. Some of these query strings are explained below:

  • tab query string, following table explain the tab value and expected results.

NOTE: For some tab value, user need to be logged in otherwise system will return an empty array.

NOTE: access-token, client and other auth headers are optional for this api. But you'll need to provide these headers if need to access private notes of author.

tab valueExplanationRequired auth headers
newestrecent posts at topNo
followingreturn reflections of authors that current user is followingYes
draftreturns current user's private notesYes
favoritereturns current user's favorite postsYes
most_populardefault tab value. Return most popular postsNo
only_room_membersSend posts that are posted by current room membersNo
publicInclude public posts of private roomsNo
feedfeed is special tab value, this will ignore most filters(See below) and send verified posts(if verified is true), posts that are reviewed by scholars, posts from author current user is following(if user is logged in) etcNo

q parameter is used for further customizing the results, you can fetch posts of specific members, post that have specific tags, post for specific surah, ayah range or single ayah etc.

Filter posts of specific users

  • q[author_ids]=1,2,3 => Get posts of author whose ids are 1,2, or 3.

Filter by specific post type

  • q[post_type_ids] -> Comma-separated post type IDs. Post Type | Post Type Id ---------|---------- Reflection | 1

Filter by Tags

  • q[tag_ids] is array query string, you can include multiple tags using following format:

q[tag_ids][]=11&q[tag_ids][]=33

Filter by specific ayah or range

  • q[filters_attributes][0][chapter_id]=1 -> Reflection of first surah

  • q[filters_attributes][0][from]=1&q[filters_attributes][0][to]: 3 -> Filter down reflection to first 3 ayah of first surah

You can use multiple filters_attributes to tailor results to your needs.

Logical operation for filters

  • q[filters_operation]= OR or AND. OR will send results that matches any filters. AND will perform inclusive operation, i.e return results that matches all conditions.
  • q[tags_operation]= OR or AND
Query Parameters
    client_auth_token string required

    Client API token

    verified boolean

    Default value: false

    If true system will send verified reflections

    lang string

    Default value: en

    Comma separated list of iso codes of languages, use this if you want to fetch posts in specific language.

    updated_since string

    Get posts that are updated after given date

    exact_ayah boolean

    Default value: false

    Get post for exact ayah, normally system will include posts for ayah range

    within_range boolean

    Get posts for ayahs that are within give filter range

    q string

    See above description

    scholar boolean

    Include scholars post

    student boolean

    Include student of knowledge member's post

    verified boolean

    shortcut if you need posts from scholars and student of knowledge members

    tab string

    Possible values: [newest, following, draft, favorite, most_popular, only_room_members, public, feed]

    see description about tab above

Header Parameters
    access-token string

    user access token

    client string

    client access token

    expiry string

    timestamp of token expiry

    Example: 1531315250
    token-type string

    access token type

    Example: Bearer
    uid string

    user uid

    Example: user@quranreflect.com
Responses

OK

Response Headers

    Schema
      posts object
      posts object[]
    • Array [
    • id integer

      The ID of the post.

      body string

      the post text

      likes integer

      The number of likes.

      draft boolean

      Whether the post should be publicly viewed or not.

      published_at string

      The date the post was published at. Format of the date is MMMM dd, yyyy HH:mm

      room_id nullable
      global boolean

      Whether the post is global or not. A post inside a room can be set to global and becomes visible to everyone.

      editable boolean

      Whether the post is editable or not. It will be true if the post belongs to the current user.

      deletable boolean

      Whether the post is deletable or not. It will be true if the post belongs to the current user.

      reportable boolean

      Whether the current user can report the post or not.

      citation_texts object[]
    • Array [
    • id integer
      text string

      translation text

      translated_name string

      name of the translation

      from integer

      from ayah number

      to integer

      to ayah number

      translation_id integer
    • ]
    • language string

      The language of the post.

      detected_translation integer
      views integer

      The number of views.

      group nullable
      group_link nullable
      comments object[]
      liked boolean
      author object
      id integer
      username string
      name string
      verified boolean
      profile_img string
      filters object[]
    • Array [
    • id integer
      from integer nullable
      to integer nullable
      indicator_text string
    • ]
    • tags object[]
    • Array [
    • id integer
      name string

      the #tag

    • ]
    • estimated_reading_time float

      Default value: 0

      The average time it takes to read the post

    • ]
    Loading...