# Language and Categories

{% hint style="info" %}
Matar supports P2P audio conversations in various languages and categories. Get a list of languages and categories via API Endpoints below.
{% endhint %}

## Get All Languages

Get a list of languages by Language ID

<img src="/files/hwaScU08iyXXh1TYl1BM" alt="API: - https://matar.in.ngrok.io/api/v1/languages" class="gitbook-drawing">

### Params

**Body Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="229.33333333333331">Body Parameter</th><th width="129">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bearer {{access_token}} </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Access token helps secure access to Matar resources.</td></tr></tbody></table>

***

**Sample Request ⬇️️ (Body Parameter)**

```
curl --location 'https://matar.in.ngrok.io/api/v1/languages' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyODcyNDIxLCJqdGkiOiIyZmNiODJiYi0zMDYzLTQzNGUtOGM5OS00NTVjMDhhY2Y3MmMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyODcyNDIxLCJleHAiOjE2OTM3MzY0MjF9.ovz0ItiPsYG_rqT3vEYl42WZBonX52NXf-oWE4DuGmQ'
```

**Responses ⬇️**

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

```200
{
    "languages": {
        "hi-IN": "हिंदी",
        "kn-IN": "ಕನ್ನಡ",
        "ur-IN": "اردو",
        "mr-IN": "मराठी",
        "ta-IN": "தமிழ்",
        "te-IN": "తెలుగు",
        "en-IN": "English"
    }
}
```

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

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

***

**Response Parameters Description**:

In the response, the language code is mapped to the language name which is used in various Matar API endpoints

***

## Get All Categories

Get Question Categories by Category ID for an organization

<img src="/files/RymE8iwQbDYFWCm3OfJw" alt="API: - https://matar.in.ngrok.io/api/v1/categories?organization_id=<ORG_ID>" class="gitbook-drawing">

### Params

**Query Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="250.33333333333331">Body Parameter</th><th width="129">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>organization_id </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>An organization ID can be fetched via Get all Organizations API endpoint.</td></tr></tbody></table>

**Header Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="229.33333333333331">Header Parameter</th><th width="129">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bearer {{access_token}} </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Access token helps secure access to Matar resources.</td></tr></tbody></table>

***

**Sample Request ⬇️️ (Body Parameter)**

```
curl --location 'https://matar.in.ngrok.io/api/v1/categories?organization_id=129487316' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6dHJ1ZSwiaWF0IjoxNjkyODcyNDIxLCJqdGkiOiIyZmNiODJiYi0zMDYzLTQzNGUtOGM5OS00NTVjMDhhY2Y3MmMiLCJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMzk1MDFUIiwibmJmIjoxNjkyODcyNDIxLCJleHAiOjE2OTM3MzY0MjF9.ovz0ItiPsYG_rqT3vEYl42WZBonX52NXf-oWE4DuGmQ'
```

**Responses ⬇️**

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

```200
{
    "categories": [
        {
            "_id": "AK9OPI",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 8,
            "title": "काम काज"
        },
        {
            "_id": "B8KIKL",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 7,
            "title": "सपने और ख्वाइशें"
        },
        {
            "_id": "WJ6BWG",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 6,
            "title": "सेहत"
        },
        {
            "_id": "LP4LJ2",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 5,
            "title": "खाना ख़ज़ाना"
        },
        {
            "_id": "KL9WNO",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 4,
            "title": "मनोरंजन"
        },
        {
            "_id": "P0OKL3",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 3,
            "title": "सबसे बड़ा रुपया"
        },
        {
            "_id": "ZESAJZ",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 2,
            "title": "समाज"
        },
        {
            "_id": "TFTWNI",
            "is_active": true,
            "parent_category_id": null,
            "sort_order": 1,
            "title": "कृषि"
        }
    ]
}
```

***

**Response Parameters Description:**

| Response Parameter   | Description                                                                           |
| -------------------- | ------------------------------------------------------------------------------------- |
| \_id                 | Six-digit alphanumerical ID mapped to a certain question category in an organization. |
| is\_active           | Denotes whether the category is active.                                               |
| parent\_category\_id | Every sub-category(child) has a parent category id.                                   |
| sort\_order          | Order in which categories are sorted and listed.                                      |
| title                | Category Title.                                                                       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gramhal.gitbook.io/matar/developer-reference/api/language-and-categories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
