📄Post Information

Get post information for different scenarios using APIs below.

Get All Posts

Get all posts by organization id.

Params

Query Parameter ⬇️

Header Parameter ⬇️


Sample Request ⬇️️

curl --location 'https://matar.in.ngrok.io/api/v1/get_post?organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyOTQzNDY0LCJqdGkiOiJmNTY2MWMzMC00YWNkLTRjNDUtYmU2NS03ZmQyOGM2OTJiYzMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyOTQzNDY0LCJleHAiOjE2OTM4MDc0NjR9.soJepZDtTK3JLfvMjl_XL5jwQr9sP8oTOiA43Fi7VZs'

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

{
    "page_details": {
        "current_start": 0,
        "next_offset": 10,
        "total": 39
    },
    "posts": [
        {
            "_id": "VAGDWM8YZP",
            "audio_data": null,
            "audio_text": "हमें अपनी अच्छी सेहत के लिए क्या करना चाहिए?",
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/RLOCWGZWM5v2Sehat_Question.flac",
            "category_ids": [
                "TFTWNI"
            ],
            "chatgpt_query_id": null,
            "child_posts": [],
            "child_posts_details": {
                "current_start": 0,
                "cursor": 0,
                "next_offset": 0,
                "total": 0
            },
            "created_at": "25/08/2023 , 06:05 AM",
            "data": {
                "duration": 4.56,
                "like": 1
            },
            "is_active": true,
            "is_chatgpt_enabled": false,
            "organization_id": "129487316",
            "parent_post_id": null,
            "sort_order": null,
            "text": "हमें अपनी अच्छी सेहत के लिए क्या करना चाहिए?",
            "user": {
                "_id": "39501T",
                "image_url": "https://listapp-images.s3.ap-south-1.amazonaws.com/matar_profile_05.png",
                "name": "Sri"
            },
            "user_id": "39501T",
            "user_post_activities": {
                "like": true
            },
            "whisper_id": null
        },
        {
            "_id": "KHNJOU",
            "audio_data": null,
            "audio_text": "मुझे अपनी अच्छी सेहत के लिए क्या करना चाहिए",
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/13TUAJ5OLCv2storage_emulated_0_Android_data_com.listag_files_DCIM_question_recording.mp3",
            "category_ids": [
                "WJ6BWG"
            ],
            "chatgpt_query_id": null,
            "child_posts": [
                {
                    "_id": "TA94F4",
                    "audio_data": null,
                    "audio_text": null,
                    "audio_translation": null,
                    "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/ZJO90T7ZS5v2audio.mp3",
                    "category_ids": [
                        "WJ6BWG"
                    ],
                    "chatgpt_query_id": null,
                    "created_at": "25/05/2023 , 06:19 AM",
                    "data": {
                        "block": 0,
                        "dislike": 1,
                        "duration": 4.98,
                        "like": 0,
                        "view": 2
                    },
                    "is_active": true,
                    "is_chatgpt_enabled": true,
                    "organization_id": "129487316",
                    "parent_post_id": "KHNJOU",
                    "sort_order": null,
                    "text": null,
                    "user": {
                        "_id": "BXLUNL",
                        "image_url": null,
                        "name": "sri"
                    },
                    "user_id": "BXLUNL",
                    "user_post_activities": {},
                    "whisper_id": null
                }
              }
            }              

Status Code: 🔴404 (404 denotes 'Not found')

{
      "message": "Ain't no cake like that."
    }

Note: The response is shortened for formatting purposes.


Get Posts with Children

Get children(answers) for a specified question post.

Params

Query Parameter ⬇️

Header Parameter ⬇️

Body Parameter ⬇️


Sample Request ⬇️️

curl --location --request GET 'https://matar.in.ngrok.io/api/v1/get_post?post_id=LX8LQC&offset=0' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyOTQzNDY0LCJqdGkiOiJmNTY2MWMzMC00YWNkLTRjNDUtYmU2NS03ZmQyOGM2OTJiYzMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyOTQzNDY0LCJleHAiOjE2OTM4MDc0NjR9.soJepZDtTK3JLfvMjl_XL5jwQr9sP8oTOiA43Fi7VZs ' \
--form 'parent_post_id="LX8LQC"'

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

{
    "_id": "LX8LQC",
    "audio_data": null,
    "audio_text": null,
    "audio_translation": null,
    "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/EWT3IROKZEaud1.m4a",
    "category_ids": [],
    "chatgpt_query_id": null,
    "child_posts": [
        {
            "_id": "H9998M",
            "audio_data": null,
            "audio_text": null,
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/C4738WZB8Caud1.m4a",
            "category_ids": [],
            "chatgpt_query_id": null,
            "data": {},
            "is_active": true,
            "parent_post_id": "LX8LQC",
            "text": "dummy text",
            "user_id": "EQOKSU",
            "whisper_id": null
        },
        {
            "_id": "LWMVZC",
            "audio_data": null,
            "audio_text": null,
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/UNMQ5Z68P8aud1.m4a",
            "category_ids": [],
            "chatgpt_query_id": null,
            "data": {},
            "is_active": true,
            "parent_post_id": "LX8LQC",
            "text": "dummy text",
            "user_id": "EQOKSU",
            "whisper_id": null
        }
    ],
    "child_posts_details": {
        "cursor": 0,
        "total": 100
    },
    "data": {},
    "is_active": true,
    "parent_post_id": null,
    "text": "dummy text",
    "user_id": "EQOKSU",
    "whisper_id": null
}      

Status Code: 🔴404 (404 denotes 'Not found')

{
      "message": "Ain't no cake like that."
    }

Get Posts with Children(Offset)

Get limited number of children(answers) for a specified question post.

Params

Query Parameter ⬇️

Header Parameter ⬇️

Body Parameter ⬇️


Sample Request ⬇️️

curl --location --request GET 'https://matar.in.ngrok.io/api/v1/get_post?post_id=LX8LQC&offset=1&organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyOTQzNDY0LCJqdGkiOiJmNTY2MWMzMC00YWNkLTRjNDUtYmU2NS03ZmQyOGM2OTJiYzMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyOTQzNDY0LCJleHAiOjE2OTM4MDc0NjR9.soJepZDtTK3JLfvMjl_XL5jwQr9sP8oTOiA43Fi7VZs' \
--form 'parent_post_id="LX8LQC"'

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

The response will list only a single child post for every post ID as offset is set to 1 in the sample request query params: 

{
    "_id": "LX8LQC",
    "audio_data": null,
    "audio_text": null,
    "audio_translation": null,
    "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/EWT3IROKZEaud1.m4a",
    "category_ids": [],
    "chatgpt_query_id": null,
    "child_posts": [
        {
            "_id": "H9998M",
            "audio_data": null,
            "audio_text": null,
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/C4738WZB8Caud1.m4a",
            "category_ids": [],
            "chatgpt_query_id": null,
            "data": {},
            "is_active": true,
            "parent_post_id": "LX8LQC",
            "text": "dummy text",
            "user_id": "EQOKSU",
            "whisper_id": null
        }
    ],
    "child_posts_details": {
        "current_start": 0,
        "cursor": 0,
        "next_offset": 2,
        "total": 2
    },
    "data": {},
    "is_active": true,
    "parent_post_id": null,
    "text": "dummy text",
    "user_id": "EQOKSU",
    "whisper_id": null
}

Status Code: 🔴404 (404 denotes 'Not found')

{
      "message": "Ain't no cake like that."
    }

Get Posts by Category

Get posts by a specific category filter.

Params

Query Parameter ⬇️

Header Parameter ⬇️


Sample Request ⬇️️

curl --location --request GET 'https://matar.in.ngrok.io/api/v1/get_post?category_id=TFTWNI&organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyOTQzNDY0LCJqdGkiOiJmNTY2MWMzMC00YWNkLTRjNDUtYmU2NS03ZmQyOGM2OTJiYzMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyOTQzNDY0LCJleHAiOjE2OTM4MDc0NjR9.soJepZDtTK3JLfvMjl_XL5jwQr9sP8oTOiA43Fi7VZs' 

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

The response will list all the posts in an organization by filtering to a specific category ID provided. Note that there are a total of 15 posts in the response below for a specified category.
Note: The response below is shortened for formatting purposes.

{
    "page_details": {
        "current_start": 0,
        "next_offset": 10,
        "total": 15
    },
    "posts": [
        {
            "_id": "VAGDWM8YZP",
            "audio_data": null,
            "audio_text": "हमें अपनी अच्छी सेहत के लिए क्या करना चाहिए?",
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/RLOCWGZWM5v2Sehat_Question.flac",
            "category_ids": [
                "TFTWNI"
            ],
            "chatgpt_query_id": null,
            "child_posts": [],
            "child_posts_details": {
                "current_start": 0,
                "cursor": 0,
                "next_offset": 0,
                "total": 0
            },
            "created_at": "25/08/2023 , 06:05 AM",
            "data": {
                "duration": 4.56,
                "like": 1
            },
            "is_active": true,
            "is_chatgpt_enabled": false,
            "organization_id": "129487316",
            "parent_post_id": null,
            "sort_order": null,
            "text": "हमें अपनी अच्छी सेहत के लिए क्या करना चाहिए?",
            "user": {
                "_id": "39501T",
                "image_url": "https://listapp-images.s3.ap-south-1.amazonaws.com/matar_profile_05.png",
                "name": "Sri"
            },
            "user_id": "39501T",
            "user_post_activities": {
                "like": true
            },
            "whisper_id": null
        },
        {
            "_id": "CONYLC",
            "audio_data": null,
            "audio_text": "श्रीमान एक किसान के तौर पर आपका सवाल है कि हम खेती लेकर किस तरह करियर बना सकते हैं और इसमें सफल होने के लिए कौनसी कदम उठाने होंगे खेती में अगर संभव हो तो कृपया उत्तर हिंदी में दें धन्यवाद",
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/53WL1YSXP4v208DY48PDIF.mp3",
            "category_ids": [
                "TFTWNI"
            ],
            "chatgpt_query_id": null,
            "child_posts": [
                {
                    "_id": "GSYRNH",
                    "audio_data": null,
                    "audio_text": null,
                    "audio_translation": null,
                    "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/O9AYC2TLXHv2storage_emulated_0_Android_data_com.mutter_files_DCIM_answer_recording.mp3",
                    "category_ids": [
                        "TFTWNI"
                    ],
                    "chatgpt_query_id": null,
                    "created_at": "17/05/2023 , 06:06 AM",
                    "data": {
                        "block": 0,
                        "dislike": 1,
                        "downvote": 0,
                        "like": 4,
                        "view": 4
                    },
                    "is_active": true,
                    "is_chatgpt_enabled": true,
                    "organization_id": "129487316",
                    "parent_post_id": "CONYLC",
                    "sort_order": null,
                    "text": null,
                    "user": {
                        "_id": "XUEWT6",
                        "image_url": "https://listapp-images.s3.ap-south-1.amazonaws.com/matar_profile_05.png",
                        "name": "shantanu"
                    },
                    "user_id": "XUEWT6",
                    "user_post_activities": {},
                    "whisper_id": null
                }
 

Status Code: 🔴404 (404 denotes 'Not found')

{
      "message": "Ain't no cake like that."
    }

Get User Posts

Get questions/posts asked by the specific user.

Params

Query Parameter ⬇️

Header Parameter ⬇️


Sample Request ⬇️️

curl --location 'https://matar.in.ngrok.io/api/v1/get_post?user_questions=true&organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkzMTYzNjYyLCJqdGkiOiI2Yzk3NTI1Mi05OWIzLTQzODEtOTU1NC0zM2VmM2ZhNTE0ZjUiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiRUE5UzZaIiwibmJmIjoxNjkzMTYzNjYyLCJleHAiOjE2OTQwMjc2NjJ9.vVll7d-oq_pNU6dDIZvmxFndZAUQ9QvTdh_AA6BvVuE'

Responses ⬇️

Status Code: 🟢200 (200 denotes 'ok')

The response will list all the posts/questions in an organization by filtering to a specific user. 

{
    "page_details": {
        "current_start": 0,
        "next_offset": 1,
        "total": 1
    },
    "posts": [
        {
            "_id": "ZNF04X",
            "audio_data": null,
            "audio_text": null,
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/8Z3IK53SUBaud1.m4a",
            "category_ids": [
                "TFTWNI"
            ],
            "chatgpt_query_id": null,
            "child_posts": [],
            "child_posts_details": {
                "current_start": 0,
                "cursor": 0,
                "next_offset": 0,
                "total": 0
            },
            "data": {},
            "is_active": true,
            "parent_post_id": null,
            "text": null,
            "user_id": "EQOKSU",
            "whisper_id": null
        }
    ]
}
 

Response Parameters Description Table

Last updated