Get Consultation List
Get Consultations List Example
For the list of all consultations for a specific user you can use the getConsultationList
with the userId
and pagination attributes page
and perPage
Check the example:
import AltibbiTelehealth
// With filtering on specific user
let userIdFilter = 999999999
ApiService.getConsultationList(userId: userIdFilter, page: 1, perPage: 20, completion: {list, failure, error in
// Handle list as an array of Consultation object
})
// Without filteration
ApiService.getConsultationList(page: 1, perPage: 20, completion: {list, failure, error in
// Handle list as an array of Consultation object
})
The
getConsultationList
will return an array of consultation data object that could be decoded to an array ofConsultationType
object or an empty array if there are no consultations yet
Responses
Status 200
Success
const response = [
{
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: {},
},
/... Other consultations ./
]
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"
}