Skip to main content

Get Last Consultation

Get Last Consultation Example

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

Check the example:

import { getLastConsultation } from 'react-native-altibbi';

const response = await getLastConsultation()

The getLastConsultation will return an array that contains one consultation object of ConsultationType or an empty array if there is no consultations yet

Responses

Status 200

Success

const response = [
{
id: 123,
userId: 999999999,
question: "I want to consult a doctor on ...",
doctorName: "Altibbi Doctor",
doctorAvatar: "url...",
medium: "chat",
status: "closed", // "in_progress" || "new"
isFulfilled: 0,
parentConsultationId: null,
createdAt: "date...",
updatedAt: "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, // 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
}
]

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