Get List of Consultations
To retrieve a list of all consultations belonging to the authenticated partner's users, use the getConsultationList method with pagination.
Usage Example:
import 'package:altibbi/service/api_service.dart';
ApiService apiService = ApiService();
void fetchHistory() async {
try {
List<Consultation> consultations = await apiService.getConsultationList(
page: 1,
perPage: 20
);
print(\"Found ${consultations.length} consultations\");
} catch (e) {
print(\"Error: $e\");
}
}
Response Structure
Returns a List<Consultation> object. If no consultations are found, an empty list is returned.
Status 200
Success
const response = [
{
id: 123,
userId: 999999999,
question: "I want to consult a doctor on ...",
doctorName: "Altibbi Doctor",
doctorAvatar: "url...",
medium: "chat",
status: "closed", // "in_progress" || "new"
isFulfilled: 0,
parentConsultationId: null,
createdAt: "date...",
updatedAt: "date...",
user: {
id: 999999999,
// ...
}, // userData
parentConsultation: null,
media: [],
pusherChannel: "channel", // Socket Channel
pusherAppKey: "key", // Socket Key
chatConfig: {
id: 1,
// ...
}, // Chat config data for chat consultations
voipConfig: null, // GSM data for gsm consultations
videoConfig: null, // Video/Voip data for voip and video consultations
chatHistory: {}, // Chat history data for chat consultations
recommendation: {}, // Recommendation data when the doctor fills the recommendation for the consultation
socketParams: {} // The data required to initiate the socket
},
/... Other consultations ./
]
// The response will be an empty array if there are no consultations done yet
// response = []
Status 401
UnauthorizedHttpException represents an Unauthorized HTTP exception with status code 401.
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials",
"code": "0",
"status": "401",
"type": "yii\\\\web\\\\UnauthorizedHttpException"
}