â“‚ī¸
Matar
  • âœī¸About Matar
  • 📁Concept
    • 📄Understanding Matar
  • 📁Matar For Communities
    • 📄Hosting on Matar
    • 📄Trial Pilot
    • 📄Community Management
  • 📁🚀 Get Started
    • 📄Language Selection
    • 📄Organization Onboarding
    • 📄Signing Up
  • 📁Matar Features
    • 📄Browsing the App
    • 📄View Questions
    • 📄Changing Subjects
    • 📄Answer Questions
    • 📄Ask a Question
    • 📄Share a Question
    • 📄Like an Answer
    • 📄See Liked Answers
    • 📄Dislike an Answer
    • 📄See Recorded Questions
    • 📄See Recorded Answers
    • 📄Troubleshooting
    • 📄Version
    • 📄FAQ
  • 📁Developer Reference
    • đŸ—„ī¸Architecture
      • 📄Overview
      • 📄Backend
      • 📄Frontend
      • 📄API Layer
    • 📜Guides
      • 📄Add/delete posts
    • đŸ› ī¸API
      • 📄API Flow
      • 📁User Login
        • 📄Login
        • 📄Submit OTP
        • 📄Get Current User
        • 📄Edit User
        • 📄Logout
      • 📄Organization Selection
      • 📄Language and Categories
      • 📄Activity Types
      • 📁Posts
        • 📄Post a New Question
        • 📄Delete a Post
        • 📄Post Activity Type
        • 📄Post Information
        • 📄Post GPT Processing
    • đŸ“ļDB Tables and Structure
      • 📄Matar DB tables
      • 📄Code Structure
    • đŸ’ģBackend Code
      • 📄Response on a Post from AI
      • 📄Post Sorting
      • 📄User Registration
      • 📄Org Based Code
    • đŸ’ģFrontend Code
      • 📄Overview
      • 📄Setting up Project
      • 📄Project Structure
      • 📄Code Directories
        • 📄Broadcast Directory
        • 📄Core Directory
        • 📄Data Directory
        • 📄di Directory
        • 📄domain/repository Directory
        • 📄model Directory
        • 📄retrofit Directory
        • 📄ui Directory
          • 📄dialog
          • 📄features
          • 📄service
  • 🤝Support
Powered by GitBook
On this page
  • Post Activity Type
  • Params
  • Get User Post Activity
  • Params
  1. Developer Reference
  2. API
  3. Posts

Post Activity Type

PreviousDelete a PostNextPost Information

Last updated 1 year ago

Perform Activity Types (like, dislike, share, etc.) on any created audio post.


Post Activity Type

Post an Activity Type on an audio post.

Params

Query Parameter âŦ‡ī¸

Query Parameter
Data Type
Description

organization_id (required)

String

6-Digit Alpha Numerical number for identifying a particular org.

Header Parameter âŦ‡ī¸

Header Parameter
Data Type
Description

Bearer {{access_token}} (required)

String

Access tokens enable secure access to Matar Resources.

Body Parameter âŦ‡ī¸

Body Parameter
Data Type
Description

post_activity_type (required)

String

Activity Type can be of 8 types reply, like, downvote, dislike, share, upvote, block, view.

To know more about activity types check the Activity Types API endpoint.

post_id (required)

String

Every created post has a unique identifier that identifies a particular audio post.


Sample Request âŦ‡ī¸ī¸

curl --location 'https://matar.in.ngrok.io/api/v1/post_activity?organization_id=685QVK' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyOTQzNDY0LCJqdGkiOiJmNTY2MWMzMC00YWNkLTRjNDUtYmU2NS03ZmQyOGM2OTJiYzMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyOTQzNDY0LCJleHAiOjE2OTM4MDc0NjR9.soJepZDtTK3JLfvMjl_XL5jwQr9sP8oTOiA43Fi7VZs' \
--header 'Content-Type: application/json' \
--data '{
    "post_activity_type": "like",
    "post_id": "VAGDWM8YZP",
    "data": {
        "hi": "hello"
    }
}'

Responses âŦ‡ī¸

Status Code: đŸŸĸ200 (200 denotes 'ok')

{
    "message": "New user activity on post",
    "post_activity": {
        "_id": "4RAY29",
        "data": {
            "hi": "hello"
        },
        "is_active": true,
        "organization_id": "685QVK",
        "post_activity_type": "like",
        "post_id": "VAGDWM8YZP",
        "user_id": "39501T"
    }
}

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

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

Response Parameters Description:

Response Parameter
Description

message

Server generated message when some new activity is detected on post

post_activity_id

A unique identifier linked to activity type on post.

post_activity_data

is active

Whether organization is active or not.

organization_id

Phone Number Linked to User Account

post_activity_type

Type of user activity on post.

post_id

Post ID linked to the post on which user activity is detected.

user_id

User ID linked to user from which activity is posted.


Get User Post Activity

Get user activity type for questions and answers posts.

Params

Query Parameter âŦ‡ī¸

Query Parameter
Data Type
Description

organization_id (required)

String

A unique identifier for organization in which question or answer is posted.

post_activity_type (optional)

String

Activity Type can be of 8 types reply, like, downvote, dislike, share, upvote, block, view. Provide any type to find the relevant type of posts.

Header Parameter âŦ‡ī¸

Header Parameter
Data Type
Description

Bearer {{access_token}} (required)

String

Access Token for securely accessing Matar server resources.


Sample Request âŦ‡ī¸ī¸

The request below will get alist of posts that are liked by user.


curl --location --request GET 'https://matar.in.ngrok.io/api/v1/user_post_activities?post_activity_type=like&organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkzMTY3MDI4LCJqdGkiOiI3YWMxYmI5Mi02MDljLTRjMzktYTliOC1kZDBhNmExOTJjZjEiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiRUE5UzZaIiwibmJmIjoxNjkzMTY3MDI4LCJleHAiOjE2OTQwMzEwMjh9.ef95SR3_rR3KkGCdIQoiZBMixU6TA2xNJ5w-i3xTtig' \
--form 'file=@"/Users/srikalyanburra/Downloads/aud1.m4a"' \
--form 'parent_post_id="LX8LQC"'

Responses âŦ‡ī¸

Status Code: đŸŸĸ200 (200 denotes 'ok')

{
    "page_details": {
        "current_start": 0,
        "next_offset": 1,
        "total": 1
    },
    "posts": [
        {
            "_id": "YQ4V7H6JN7",
            "audio_data": null,
            "audio_text": "ā¤šā¤ŽāĨ‡ā¤‚ ⤅ā¤Ē⤍āĨ€ ā¤…ā¤šāĨā¤›āĨ€ ⤏āĨ‡ā¤šā¤¤ ⤕āĨ‡ ⤞ā¤ŋā¤ ⤕āĨā¤¯ā¤ž ā¤•ā¤°ā¤¨ā¤ž ā¤šā¤žā¤šā¤ŋā¤?",
            "audio_translation": null,
            "audio_url": "https://matar-audio.s3.ap-south-1.amazonaws.com/26O9BZNI43v2Sehat_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": "27/08/2023 , 08:13 PM",
            "data": {
                "duration": 4.56,
                "like": 1
            },
            "is_active": true,
            "is_chatgpt_enabled": false,
            "organization_id": "129487316",
            "parent_post": {},
            "parent_post_id": null,
            "sort_order": null,
            "text": "ā¤šā¤ŽāĨ‡ā¤‚ ⤅ā¤Ē⤍āĨ€ ā¤…ā¤šāĨā¤›āĨ€ ⤏āĨ‡ā¤šā¤¤ ⤕āĨ‡ ⤞ā¤ŋā¤ ⤕āĨā¤¯ā¤ž ā¤•ā¤°ā¤¨ā¤ž ā¤šā¤žā¤šā¤ŋā¤?",
            "user": {
                "_id": "EA9S6Z",
                "image_url": null,
                "name": "Sri"
            },
            "user_id": "EA9S6Z",
            "user_post_activities": {
                "like": true
            },
            "whisper_id": null
        }
    ]
}

Response Parameters Description:

Response Parameter
Description

page_details_current_start

Current post page number.

page_details_next_offset

Set a particular page number to start for post-viewing via offset.

page_details _total

Total number of post pages available to view.

post_id

A unique identifier linked to posted audio 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.

child_posts

Contains list of child posts. A child post is a answer/reply post to the parent/question post.

child_posts_current_start

Current child post page number.

child_posts_cursor

child_posts_next_offset

Set a particular page number to start from for child post-viewing via offset.

total

Total number of child posts

chatgpt_query_id

A chatgpt identifier linked to audio question asked by users.

created_at

Post creation date

duration

Duration of audio post in minutes and seconds.

like

Total number of likes for the post.

is_active

Is the organization active or not.

is_chatgpt_enabled

Is chat gpt enabled to answer to question post inn an organization

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.

user_post_activities

Any post activity performed by the linked user.

whisper_id

Used internally for speech-to-text tasks.

📁
đŸ› ī¸
📁
📄
Drawing
API: -
Drawing
API: -
https://matar.in.ngrok.io/api/v1/post_activity?organization_id=<ORG_ID>
https://matar.in.ngrok.io/api/v1/user_post_activities?post_activity_type=<ACTIVITY_TYPE>&organization_id=<ORG_ID>