๐Ÿ“„Post a New Question

Post a New Question for audio conversations.

Post new Question

Params

Query Parameter โฌ‡๏ธ

Query ParameterData TypeDescription

organization_id (required)

String

Organization ID in which post has to be created

Header Parameter โฌ‡๏ธ

Header ParameterData TypeDescription

Bearer {{access_token}} (required)

String

Access tokens securely contain details for the user posting the question as an audio file.

Body Parameter โฌ‡๏ธ

Body ParameterData TypeDescription

file (required)

String

Audio file to post. Audio Format Supported types: flac single channel mono audio. Max audio duration: 120 seconds

category_id (required)

String

A category ID in which an audio post has to be uploaded. Some categories are science, happiness, society, fitness, etc.

To see a list of known Categories with respect to Category ID mapping check Get all Categories API Endpoint.


Sample Request โฌ‡๏ธ๏ธ

curl --location 'https://matar.in.ngrok.io/api/v1/new_post?organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyODcyNDIxLCJqdGkiOiIyZmNiODJiYi0zMDYzLTQzNGUtOGM5OS00NTVjMDhhY2Y3MmMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyODcyNDIxLCJleHAiOjE2OTM3MzY0MjF9.ovz0ItiPsYG_rqT3vEYl42WZBonX52NXf-oWE4DuGmQ' \
--form 'file=@"YcyZ1KDNO/Sehat Question.flac"' \
--form 'category_id="TFTWNI"'

Responses โฌ‡๏ธ

Status Code: ๐ŸŸข200 (200 denotes 'ok')

{
    "message": "Post received.. generated transcription",
    "post": {
        "_id": "ACDM6HSQB3",
        "audio_data": null,
        "audio_text": "เคนเคฎเฅ‡เค‚ เค…เคชเคจเฅ€ เค…เคšเฅเค›เฅ€ เคธเฅ‡เคนเคค เค•เฅ‡ เคฒเคฟเค เค•เฅเคฏเคพ เค•เคฐเคจเคพ เคšเคพเคนเคฟเค?",
        "audio_translation": null,
        "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/IT8WGDH8Z4v2Sehat_Question.flac",
        "category_ids": [
            "TFTWNI"
        ],
        "chatgpt_query_id": null,
        "created_at": "24/08/2023 , 10:36 AM",
        "data": {
            "duration": 4.56
        },
        "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",
        "whisper_id": null
    }
}

Status Code: ๐Ÿ”ด400 (400 denotes 'Bad request')

/// Response 1
{
    "error": "No file provided"
}
///// Response 2
{
    "message": "no such category"
}

Response Parameters Description:

Response ParameterDescription

message

A response message displayed by servers when a question is successfully posted.

post_id

A unique identifier generated in map to posted question.

post_audio_text

Contains transcribed version of audio post.

post_audio_url

URL of where audio post is stored.

category_ids

A unique identifier containing the category in which question is posted.

chatgpt_query_id

A chatgpt unique identifier linked to audio question asked by users.

created_at

Post creation date

duration

Duration of audio post in minutes and seconds.

is_active

Is organization active or not.

is_chatgpt_enabled

Is chat gpt enabled to answer to post.

organization_id

Organization in which the question is posted.

parent_post_id

If question post has replies or child post then the question has a valid parent_post_id. parent_post_id is set to null when question post has no replies.

sort_order

When there are multiple posts to display they are sorted by sort order and has a number assigned to it. If there is a single post to display the sort_order will be set to null.

text

Contains post text transcribed from audio.

user_id

User ID of the account from which audio is posted.

user image_url

Image URL containing the user account image.

user_name

Name for the user account.

whisper_id

Used internally for speech-to-text tasks.


Create a Child Post.

Params

Query Parameter โฌ‡๏ธ

Body ParameterData TypeDescription

organization_id (required)

String

Organization ID in which post has to be created

Header Parameter โฌ‡๏ธ

Header ParameterData TypeDescription

Bearer {{access_token}} (required)

String

Access tokens securely contain details for the user posting the question as an audio file.

Body Parameter โฌ‡๏ธ

Header ParameterData TypeDescription

file (required)

String

Audio file containing the answer. Audio Format Supported types: flac single channel mono audio. Max audio duration: 120 seconds

category_id (required)

String

A category ID in which a post is uploaded. Some categories are science, happiness, society, fitness, etc.

To see a list of known Categories with respect to Category ID mapping check Get all Categories API Endpoint.

parent_post_id (required)

String

Parent Post ID is the Post ID of the posted Question to link child/answer post.


Sample Request โฌ‡๏ธ๏ธ

curl --location 'https://matar.in.ngrok.io/api/v1/new_post?organization_id=K7QUEV' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkzMjk4NDEwLCJqdGkiOiJiYmE3NzdhYy05MTA5LTQyOTQtYjhkNy04NmQ1NDZiNTVmOGEiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiRUE5UzZaIiwibmJmIjoxNjkzMjk4NDEwLCJleHAiOjE2OTQxNjI0MTB9.qn7dyTb9ws4lrGdAoh6rAzu24gos-EIY3lbloFJTrH4' \
--form 'file=@"xglbaJXSR/Sehat Question.flac"' \
--form 'parent_post_id="9TX90RLDR4"' \
--form 'category_id="TFTWNI"'

Responses โฌ‡๏ธ

Status Code: ๐ŸŸข200 (200 denotes 'ok')

{
    "message": "Post received.. generated transcription",
    "post": {
        "_id": "K74Q9PXAXG",
        "audio_data": null,
        "audio_text": null,
        "audio_translation": null,
        "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/L89W2SSZRBv2Sehat_Question.flac",
        "category_ids": [
            "TFTWNI"
        ],
        "chatgpt_query_id": null,
        "created_at": "29/08/2023 , 12:02 PM",
        "data": {
            "duration": 4.56
        },
        "is_active": true,
        "is_chatgpt_enabled": false,
        "organization_id": "K7QUEV",
        "parent_post_id": "9TX90RLDR4",
        "sort_order": null,
        "text": null,
        "user": {
            "_id": "EA9S6Z",
            "image_url": "https://listapp-images.s3.ap-south-1.amazonaws.com/matar_profile_05.png",
            "name": "shantanu"
        },
        "user_id": "EA9S6Z",
        "whisper_id": null
    }
}

Status Code: ๐Ÿ”ด400 (400 denotes 'Bad request')

/// Response 1
{
    "error": "No file provided"
}
///// Response 2
{
    "message": "no such category"
}

Response Parameters Description:

Response ParameterDescription

message

A response message displayed by servers when a question is successfully posted.

post_id

A unique identifier generated in map to posted question.

post_audio_text

Contains transcribed version of audio post.

post_audio_url

URL of where audio post is stored.

category_ids

A unique identifier containing the category in which question is posted.

chatgpt_query_id

created_at

Post creation date

duration

Duration of audio post in minutes and seconds.

is_active

is_chatgpt_enabled

Is chat gpt enabled to answer to post.

organization_id

Organization in which the question is posted.

parent_post_id

If question post has replies or child post then the question has a valid parent_post_id. parent_post_id is set to null when question post has no replies.

sort_order

When there are multiple posts to display they are sorted by sort order and has a number assigned to it. If there is a single post to display the sort_order will be set to null.

text

Contains post text transcribed from audio.

user_id

User ID of the account from which audio is posted.

user image_url

Image URL containing the user account image.

user_name

Name for the user account.

whisper_id

Used internally for speech-to-text tasks.

Last updated