Get Consultation Data
getConsultationInfo
For getting the data of a consultation you need to use getConsultationInfo and provide the consultation_id.
Parameters
- consultation_id: (number) - The ID of the consultation to retrieve.
Returns
Promise<ResponseType<ConsultationType>>: A promise that resolves with aConsultationTypeobject containing the consultation data.
Example
import { getConsultationInfo } from 'react-web-altibbi';
const response = await getConsultationInfo(123);
If the consultation has a realtime channel (
pusherAppKey/pusherChannel), the response will also include asocketParamsobject ready to be passed toTBISocket.init().
Responses
Status 200
Success
{
"id": 123,
"user_id": 999999999,
"question": "I want to consult a doctor on ...",
"medium": "chat",
"status": "in_progress",
"pusherChannel": "channel",
"pusherAppKey": "key",
"socketParams": {
"apiKey": "key",
"cluster": "eu",
"authEndpoint": "endpoint"
},
"chatConfig": {},
"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"
}
Status 404
Consultation ID invalid or deleted.
{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\web\\NotFoundHttpException"
}