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 AltibbiTelehealth
let consultationId = 123
ApiService.getConsultationInfo(id: consultationId, completion: {consultation, failure, error in
// Handle consultation as a Consultation object
})
The
getConsultationInfo
will return a consultation data object that could be decoded toConsultation
object
Responses
Status 200
Success
{
consultationId: 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,
// ...
}, // User
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
}], // Array of Media objects
socketChannel: "channel", // Socket Channel
socketKey: "key", // Socket Key
chatConfig: {
id: 1,
// ...
}, // ChatConfig object data for chat consultations
voipConfig: null, // VoipConfig object data for VOIP consultations
videoConfig: null, // VoipConfig object data for Vidoe consultations
chatHistory: {}, // ChatHistory object data for chat consultations
recommendation: {}, // Recommendation object data when the doctor fills the recommendation for the consultation
}
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"
}