Freeform Answer
The freeformAnswer API is used to submit a Freeform Answer to the Feedback API. This API is used to collect feedback from users in the form of a freeform text response.
API BASE URL: https://addhuri.com/api/lib/feedback
POST API
This POST request can be used to submit a Freeform Answer to the Feedback API.
Request Endpoint
POST /freeformAnswer
Request Headers
Use the poster API key in the request headers to authenticate the request.
{ "Content-Type": "application/json", "x-api-key-poster": "YOUR_POSTER_API_KEY",}Request Body
{ "question": "string", "answer": "string", "data": { }}Response Body
{ "data": { "id": "string" }, "message": "Feedback saved successfully", "status": "success"}Example
Here is an example of how to submit a Freeform Answer to the Feedback API using different programming languages and tools.
const API_BASE_URL = 'https://addhuri.com/api/lib/feedback'const URL = `${API_BASE_URL}/freeformAnswer`const POSTER_API_KEY = 'YOUR_POSTER_API_KEY'
fetch(URL, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key-poster': POSTER_API_KEY }, body: JSON.stringify({ question: 'Should feedback be anonymous?', answer: 'Yes, feedback should be anonymous to encourage honest responses.', data: { key: 'value pairs for saving additional data', like: 'application or source identifier etc.' } })})import requests
API_BASE_URL = 'https://addhuri.com/api/lib/feedback'URL = f'{API_BASE_URL}/freeformAnswer'POSTER_API_KEY = 'YOUR_POSTER_API_KEY'
headers = { 'Content-Type': 'application 'x-api-key-poster': POSTER_API_KEY}data = { 'question': 'Should feedback be anonymous?', 'answer': 'Yes, feedback should be anonymous to encourage honest responses.', 'data': { 'key': 'value pairs for saving additional data', 'like': 'application or source identifier etc.' }}
response = requests.post(URL, headers=headers, json=data)curl -X POST "https://addhuri.com/api/lib/feedback/freeformAnswer" \-H "Content-Type: application/json" \-H "x-api-key-poster: YOUR_POSTER_API_KEY" \-d '{ "question": "Should feedback be anonymous?", "answer": "Yes, feedback should be anonymous to encourage honest responses.", "data": { "key": "value pairs for saving additional data", "like": "application or source identifier etc." }}'GET API
This GET request can be used to retrieve records from the Feedback API.
Request Endpoint
GET /freeformAnswer
Request Headers
Use the master API key in the request headers to authenticate the request.
{ "Content-Type": "application/json", "x-api-key-master": "YOUR_MASTER_API_KEY",}Request Query Parameters
Use the following query parameters to retrieve records from the Feedback API.
GET /freeformAnswer?page=1&limit=10
| Parameter | Type | Default | Min | Max | Description |
|---|---|---|---|---|---|
| page | number | 1 | 1 | - | The page number to retrieve. |
| limit | number | 10 | 1 | 100 | The number of items to retrieve per page. |
Response Body
The response will contain an array of Freeform Answer.
{ "data": [ { "type": "FreeformAnswer", "id": "e41082b2-f54c-4201-8387-476f4ce8ae4d", "createdAt": "2024-11-22T06:09:53.133Z", "updatedAt": "2024-11-22T06:09:53.133Z", "question": "string", "answer": "string", "data": { } } ], "page": 1, "limit": 10, "total": 15, "totalPages": 2, "message": "", "status": "success"}Example
Here is an example of how to submit a Freeform Answer to the Feedback API using different programming languages and tools.
const API_BASE_URL = 'https://addhuri.com/api/lib/feedback'const URL = `${API_BASE_URL}/freeformAnswer`const MASTER_API_KEY = 'YOUR_MASTER_API_KEY'
fetch(URL, { method: 'GET', headers: { 'Content-Type': 'application/json', 'x-api-key-master': MASTER_API_KEY }})import requests
API_BASE_URL = 'https://addhuri.com/api/lib/feedback'URL = f'{API_BASE_URL}/freeformAnswer'MASTER_API_KEY = 'YOUR_MASTER_API_KEY'
headers = { 'Content-Type': 'application 'x-api-key-master': MASTER_API_KEY}
response = requests.get(URL, headers=headers)curl -X GET "https://addhuri.com/api/lib/feedback/freeformAnswer" \-H "Content-Type: application/json" \-H "x-api-key-master: MASTER_API_KEY"