Cancel Consultation
A consultation can be cancelled while it is in the new or in_progress status. Use the cancelConsultation method by providing the consultation ID.
Usage Example:
import 'package:altibbi/service/api_service.dart';
ApiService apiService = ApiService();
void handleCancel(int id) async {
try {
var response = await apiService.cancelConsultation(id);
print(\"Consultation ${response['consultation_id']} cancelled. Status: ${response['status']}\");
} catch (e) {
print(\"Cancellation Error: $e\");
}
}
Note: The
cancelConsultationmethod returns a dynamic object containing theconsultation_idand the updatedstatus(usuallyclosed).
Responses
Status 200 (Success)
{
\"consultation_id\": 123,
\"status\": \"closed\"
}
Status 401 (Unauthorized)
Returned if the partner token is invalid or expired.
Status 404 (Not Found)
Returned if the consultation ID does not exist or has already been deleted.