cURL
curl --request GET \
--url https://grm-api.vercel.app/grievances/user/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://grm-api.vercel.app/grievances/user/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://grm-api.vercel.app/grievances/user/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://grm-api.vercel.app/grievances/user/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://grm-api.vercel.app/grievances/user/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://grm-api.vercel.app/grievances/user/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://grm-api.vercel.app/grievances/user/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"total": 123,
"page": 123,
"size": 123,
"grievances": [
{
"title": "<string>",
"category": "<string>",
"description": "<string>",
"id": "<string>",
"user_id": "<string>",
"status": "Pending",
"created_at": "2023-11-07T05:31:56Z",
"priority": "medium",
"cpgrams_category": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"resolution_notes": "<string>",
"grievance_received_date": "2023-11-07T05:31:56Z",
"grievance_closing_date": "2023-11-07T05:31:56Z",
"organisation_closing_date": "2023-11-07T05:31:56Z",
"org_status_date": "2023-11-07T05:31:56Z",
"reported_as_covid19_case_date": "2023-11-07T05:31:56Z",
"covid19_category": "<string>",
"reformed_flag": false,
"reformed_top_level_category": "<string>",
"reformed_last_level_category": "<string>",
"forwarded_to_subordinate": false,
"forwarded_to_subordinate_details": "<string>",
"rating": 123,
"feedback": "<string>",
"satisfaction_level": "<string>",
"final_reply": "<string>",
"appeal_no": "<string>",
"appeal_date": "2023-11-07T05:31:56Z",
"appeal_reason": "<string>",
"appeal_closing_date": "2023-11-07T05:31:56Z",
"appeal_closing_remarks": "<string>",
"organisation_grievance_receive_date": "2023-11-07T05:31:56Z",
"organisation_grievance_close_date": "2023-11-07T05:31:56Z",
"officers_forwarding_grievance": "<string>",
"date_of_receiving": "2023-11-07T05:31:56Z",
"officer_closed_by": "<string>",
"final_status": "<string>",
"classified_category": "<string>",
"formatted_fields": "<string>",
"follow_up_questions": [
"<string>"
],
"missing_information": true,
"is_correct_category": true,
"category_data": {}
}
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Endpoint Examples
Get User Grievances
Get all grievances for a specific user with pagination support
GET
/
grievances
/
user
/
{user_id}
cURL
curl --request GET \
--url https://grm-api.vercel.app/grievances/user/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://grm-api.vercel.app/grievances/user/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://grm-api.vercel.app/grievances/user/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://grm-api.vercel.app/grievances/user/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://grm-api.vercel.app/grievances/user/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://grm-api.vercel.app/grievances/user/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://grm-api.vercel.app/grievances/user/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"total": 123,
"page": 123,
"size": 123,
"grievances": [
{
"title": "<string>",
"category": "<string>",
"description": "<string>",
"id": "<string>",
"user_id": "<string>",
"status": "Pending",
"created_at": "2023-11-07T05:31:56Z",
"priority": "medium",
"cpgrams_category": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"resolution_notes": "<string>",
"grievance_received_date": "2023-11-07T05:31:56Z",
"grievance_closing_date": "2023-11-07T05:31:56Z",
"organisation_closing_date": "2023-11-07T05:31:56Z",
"org_status_date": "2023-11-07T05:31:56Z",
"reported_as_covid19_case_date": "2023-11-07T05:31:56Z",
"covid19_category": "<string>",
"reformed_flag": false,
"reformed_top_level_category": "<string>",
"reformed_last_level_category": "<string>",
"forwarded_to_subordinate": false,
"forwarded_to_subordinate_details": "<string>",
"rating": 123,
"feedback": "<string>",
"satisfaction_level": "<string>",
"final_reply": "<string>",
"appeal_no": "<string>",
"appeal_date": "2023-11-07T05:31:56Z",
"appeal_reason": "<string>",
"appeal_closing_date": "2023-11-07T05:31:56Z",
"appeal_closing_remarks": "<string>",
"organisation_grievance_receive_date": "2023-11-07T05:31:56Z",
"organisation_grievance_close_date": "2023-11-07T05:31:56Z",
"officers_forwarding_grievance": "<string>",
"date_of_receiving": "2023-11-07T05:31:56Z",
"officer_closed_by": "<string>",
"final_status": "<string>",
"classified_category": "<string>",
"formatted_fields": "<string>",
"follow_up_questions": [
"<string>"
],
"missing_information": true,
"is_correct_category": true,
"category_data": {}
}
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Retrieves all grievances associated with a specific user, with support for pagination. This endpoint allows you to fetch either all grievances for a user or paginate through them using the query parameters.
Pagination
The endpoint supports the following query parameters for pagination:fetch_all(boolean): When set totrue, returns all grievances for the user without pagination. Default isfalse.page(integer): The page number to retrieve. Default is 1.size(integer): Number of grievances per page. Default is 10, maximum is 100.
Response
The response includes:status: Operation statustotal: Total number of grievances for the userpage: Current page numbersize: Number of items per pagegrievances: Array of grievance objects with complete details
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the user whose grievances to fetch
Query Parameters
Whether to fetch all grievances or paginate
Page number for pagination
Required range:
x >= 1Number of items per page
Required range:
1 <= x <= 100