Get Consultation List
getConsultationList
For the list of all consultations for a specific user you can use getConsultationList
with the optional user_id and pagination attributes page and perPage.
Parameters
- user_id: (number?) - The ID of the user to filter consultations. Optional — if not provided, returns all consultations.
- page: (number) - The page number for pagination. Default:
1. - perPage: (number) - The number of items per page. Default:
20.
Returns
Promise<ResponseType<ConsultationType[]>>: A promise that resolves with an array ofConsultationTypeobjects, or an empty array if there are no consultations yet.
Example
import { getConsultationList } from 'react-native-altibbi';
const response = await getConsultationList(999999999, 1, 10);
Responses
Status 200
Success
const response = [
{
id: 123,
user_id: 999999999,
question: "I want to consult a doctor on ...",
doctor_name: "Altibbi Doctor",
doctor_avatar: "url...",
doctor_average_rating: 4,
medium: "chat",
status: "closed", // 'new','checking_medical_profile','in_progress','closed'
is_fulfilled: 0,
parent_consultation_id: null,
consultation_category_id: null,
created_at: "date...",
updated_at: "date...",
closed_at: "date...",
accepted_at: "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, // VOIP data for voip consultations
videoConfig: null, // Video data for video consultations
chatHistory: {}, // Chat history data for chat consultations
recommendation: {}, // Recommendation data when the doctor fills the recommendation
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"
}