Get Consultation Data
Get Consultation Example
For getting the data of a consultation you need to use the getConsultationInfo
and provide the id
for that consultation
Check the example:
import 'package:altibbi/service/api_service.dart';
ApiService apiService = ApiService();
var consultation = await apiService.getConsultationInfo(int.parse(idController.text));
The
getConsultationInfo
will return a consultation data object that could be decoded toConsultation
object
Responses
Status 200
Success
const response = {
id: 123,
userId: 999999999,
question: "I want to consult a doctor on ...",
doctorName: "Altibbi Doctor",
doctorAvatar: "url...",
doctorAverageRating: 4,
medium: "chat",
status: "closed", // 'new','checking_medical_profile','in_progress','closed'
isFulfilled: 0,
parentConsultationId: null,
createdAt: "date...",
updatedAt: "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?: number; // Sample 22256
}]
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
}
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"
}