method = WP_REST_Server::READABLE; $this->route = '/engagement/(?P[\\d]+)'; } public function process_api_call() { $e_id = $this->get_sanitized_arg( 'e_id' ); $engagement = BWFAN_Core()->conversations->get_conversation_email( $e_id ); if ( empty( $engagement ) || ! is_array( $engagement ) ) { $message = $engagement['error'] ?? 'Unknown error occurred'; return $this->error_response( $message, null, 500 ); } return $this->success_response( $engagement ); } } BWFAN_API_Loader::register( 'BWFAN_API_Get_Engagement_Details' );