Skip to main content

Get Last Consultation

Get Last Consultation Example

You can use the getLastConsultation method to get the Consultation data object of the last consultation done for the user

Check the example:

import AltibbiTelehealth

ApiService.getLastConsultation(completion: {consultation, failure, error in
// Handle consultation as a Consultation object
})

Responses

Status 200

Success

{
consultationId: 123,
userId: 999999999,
question: "I want to consult a doctor on ...",
doctorName: "Altibbi Doctor",
doctorAvatar: "url...",
medium: "chat",
status: "closed",
isFulfilled: 0,
parentConsultationId: null,
createdAt: "date...",
updatedAt: "date...",
user: {
id: 999999999,
// ...
},
parentConsultation: null,
media: [],
socketChannel: "channel",
socketKey: "key",
chatConfig: {
id: 1,
// ...
},
voipConfig: null,
videoConfig: null,
chatHistory: {},
recommendation: {},
}

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"
}