Skip to main content

Get Consultation List

Get Consultations List Example

For the list of all consultations for a specific user you can use the getConsultationList with the user_id and pagination attributes page and perPage

Check the example:

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

const response = await getConsultationList(999999999, 1, 10)

The getConsultationList will return an array of consultation data object that could be decoded to an array of ConsultationType object or an empty array if there are 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
},
/... Other consultations ./
]

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