getConsultationInfo method

Future<Consultation> getConsultationInfo(
  1. int consultationID
)

Retrieves the consultation information for the given consultationID from the API. Returns the consultation object if the API call is successful.

Implementation

Future<Consultation> getConsultationInfo(int consultationID) async {
  final response = await callApi(
      endpoint: 'consultations/$consultationID',
      method: 'get',
      body: {
        "expand":
            "pusherAppKey,parentConsultation,consultations,user,media,pusherChannel,"
                "chatConfig,chatHistory,voipConfig,videoConfig,recommendation"
      });
  if (response.statusCode == 200) {
    final responseData = json.decode(response.body);
    final consultation = Consultation.fromJson(responseData);
    return consultation;
  } else {
    throw Exception(response);
  }
}