Get Consultation Data
getConsultationInfo
For getting the data of a consultation you need to use getConsultationInfo and provide the consultation_id.
Parameters
- consultation_id: (number) - The ID of the consultation to retrieve.
Returns
Promise<ResponseType<ConsultationType>>: A promise that resolves with aConsultationTypeobject containing the consultation data.
Example
import { getConsultationInfo } from 'react-native-altibbi';
const response = await getConsultationInfo(123);
The
getConsultationInfowill return a consultation data object that can be decoded toConsultationTypeobject.
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: [{
id: "string", // Sample: "181"
type: "string", // Either 'image','doc'
name: "string", // Sample: "B644C0E123ASDWWQ"
path: "string", // Sample: 'doc/2023/09/11/cee06efe787fc145d1de5f4373abd417.pdf'
extension: "string", // Sample: 'pdf'
url: "string", // Sample: 'www.altibbi.com/doc/2023/09/11/cee06efe787fc145d1de5f4373abd417.pdf'
size: 22256,
}],
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
};
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"
}
Status 404
Consultation ID invalid or deleted.
{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\web\\NotFoundHttpException"
}