# Get FAQ Category API

## Get FAQ Category.

<mark style="color:green;">`POST`</mark> [https://\<sub domain>.kapturecrm.com/get-all-faq-categories.html](https://hamilton.kapturecrm.com/get-all-faq-categories.html)[](<https://devapi.kapturecrm.com/select-customer-between-start-and-end-dates.html&#xD;&#xA;>)

{% hint style="info" %}

```
NOTE: Please replace with your sub domain name in the API.
```

{% endhint %}

### Authentication:

To access this API endpoint, you need to include your API key in the request headers. For authentication, use the following header:

```
Basic <Your Token>
```

### Request Body

There will be no body for the API we just need to pass the Authorization Key into the Headers.<br>

### Response Body

The API responds with a JSON object containing the details of the all the category in the system along with the category Id's.

| Response                                           | Response Messages                                                                   |
| -------------------------------------------------- | ----------------------------------------------------------------------------------- |
| { ..., "status": "success"}                        | List of customers fetched successfully.                                             |
| {"message": "Invalid Auth Key","status": "failed"} | Authorization key is either not passed in header, or incorrect, or expired/disabled |

{% tabs %}
{% tab title="Response" %}

```json
{
    "message": {
        "category": [
            {
                "id": 5214,
                "name": "Milton",
                "detail": "",
                "parentCategoryName": "Add as Parent Category",
                "categoryPath": "5213/"
            },
            {
                "id": 5215,
                "name": "Claro",
                "detail": "",
                "parentCategoryName": "Add as Parent Category",
                "categoryPath": "5213/"
            },
            {
                "id": 5216,
                "name": "Spotzero",
                "detail": "",
                "parentCategoryName": "Add as Parent Category",
                "categoryPath": "5213/"
            },
            {
                "id": 5217,
                "name": "Treo",
                "detail": "",
                "parentCategoryName": "Add as Parent Category",
                "categoryPath": "5213/"
            },
            {
                "id": 5245,
                "name": "FAQ - Milton",
                "detail": "",
                "parentCategoryName": "Milton",
                "categoryPath": "5213/5214/"
            },
            {
                "id": 5246,
                "name": "FAQ - Treo",
                "detail": "",
                "parentCategoryName": "Treo",
                "categoryPath": "5213/5217/"
            },
            {
                "id": 5247,
                "name": "FAQ - Claro",
                "detail": "",
                "parentCategoryName": "Claro",
                "categoryPath": "5213/5215/"
            },
            {
                "id": 5248,
                "name": "FAQ - Spotzero",
                "detail": "",
                "parentCategoryName": "Spotzero",
                "categoryPath": "5213/5216/"
            }
        ]
    },
    "status": "success"
}
```

{% endtab %}
{% endtabs %}

### Error Codes

| Error Codes | Description                                      |
| ----------- | ------------------------------------------------ |
| 400         | Bad Request - Invalid parameters or missing data |
| 401         | Unauthorized - Invalid or missing API key        |
| 403         | Forbidden - Insufficient permissions             |
| 404         | Not Found - Resource or endpoint not found       |
| 500         | Internal Server Error - Server-side issue        |

### Example of a working curl

{% tabs %}
{% tab title="cURL" %}

```json
curl --location --request POST 'hamilton.kapturecrm.com/get-all-faq-categories.html' \
--header 'Cookie: JSESSIONID=; _KAPTURECRM_SESSION=; JSESSIONID=; JSESSIONID=7' \
--header 'Authorization: Basic <Your Token>'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "hamilton.kapturecrm.com/get-all-faq-categories.html"

payload = {}
headers = {
  'Cookie': 'JSESSIONID=; _KAPTURECRM_SESSION=; JSESSIONID=; JSESSIONID=',
  'Authorization': 'Basic <Your Token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Node.js" %}

```
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'hamilton.kapturecrm.com/get-all-faq-categories.html',
  'headers': {
    'Cookie': 'JSESSIONID=; _KAPTURECRM_SESSION=; JSESSIONID=; JSESSIONID=',
    'Authorization': 'Basic <Your Token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

{% endtab %}
{% endtabs %}


---

# 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://dev.kapture.cx/kapture-api/reference/api-reference/get-faq-category-api.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.
