cURL
curl --request GET \ --url https://api.example.com/api/unions
{ "success": true, "data": [ { "id": "<string>", "name": "<string>", "location": "<string>", "address": "<string>", "creditOfficerId": "<string>", "creditOfficer": { "id": "<string>", "firstName": "<string>", "lastName": "<string>", "email": "<string>" }, "createdAt": "<string>", "updatedAt": "<string>" } ], "pagination": { "total": 123, "page": 123, "limit": 123, "pages": 123 } }
Authorization: Bearer <token>
Show Union properties
Show Officer properties
Show Pagination properties
curl --request GET \ --url 'https://api.example.com/api/unions?page=1&limit=20&creditOfficerId=clx1234567890' \ --header 'Authorization: Bearer <token>'
{ "success": true, "data": [ { "id": "clx9876543210", "name": "Central Farmers Union", "location": "Lagos", "address": "123 Main Street, Ikeja, Lagos", "creditOfficerId": "clx1234567890", "creditOfficer": { "id": "clx1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]" }, "createdAt": "2024-03-15T10:30:00.000Z", "updatedAt": "2024-03-15T10:30:00.000Z" } ], "pagination": { "total": 45, "page": 1, "limit": 20, "pages": 3 } }
{ "success": false, "message": "Unauthorized" }
{ "success": false, "message": "Failed to fetch unions" }