Retrieving service status

You can check the general health status of the services provided by the Breez SDK. The response status will inform you if there is maintenance occurring, a service disruption or the services are operational.

Rust
let api_key = "<api key>".to_string();

let health_check = BreezServices::service_health_check(api_key).await?;
info!("Current service status is: {:?}", health_check.status);
Swift
if let healthCheck = try? serviceHealthCheck(apiKey: "<api key>") {
    print("Current service status is: \(healthCheck.status)")
}
Kotlin
try {
    val healthCheck = serviceHealthCheck("<api key>")
    // Log.v("Breez", "Current service status is: ${healthCheck.status}")
} catch (e: Exception) {
    // Handle error
}
React Native
try {
  const healthCheck = await serviceHealthCheck('<api key>')
  console.log(`Current service status is: ${healthCheck.status}`)
} catch (err) {
  console.error(err)
}
Dart
ServiceHealthCheckResponse healthCheck = await BreezSDK().serviceHealthCheck(apiKey: "<api key>");
print("Current service status is: ${healthCheck.status}");
Python
health_check = breez_sdk.service_health_check("<api key>")
print("Current service status is: ", health_check.status)
Go
if healthCheck, err := breez_sdk.ServiceHealthCheck("<api key>"); err != nil {
    log.Printf("Current service status is: %v", healthCheck.Status)
}
C#
try
{
    var healthCheck = BreezSdkMethods.ServiceHealthCheck("<api key>");
    Console.WriteLine($"Current service status is: {healthCheck.status}");
}
catch (Exception)
{
    // Handle error
}