diff --git a/Tranga/Server/v2NotificationConnectors.cs b/Tranga/Server/v2NotificationConnectors.cs index 741b2d6..d6917fb 100644 --- a/Tranga/Server/v2NotificationConnectors.cs +++ b/Tranga/Server/v2NotificationConnectors.cs @@ -63,9 +63,11 @@ public partial class Server case NotificationConnector.NotificationConnectorType.Ntfy: if(!requestParameters.TryGetValue("url", out url)) return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'url' missing."); - if(!requestParameters.TryGetValue("auth", out string? auth)) - return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'auth' missing."); - Ntfy ntfy = new(this, url, auth); + if(!requestParameters.TryGetValue("username", out string? username)) + return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'username' missing."); + if(!requestParameters.TryGetValue("password", out string? password)) + return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'password' missing."); + Ntfy ntfy = new(this, url, username, password, null); this.notificationConnectors.RemoveWhere(nc => nc.notificationConnectorType == NotificationConnector.NotificationConnectorType.Ntfy); this.notificationConnectors.Add(ntfy); @@ -103,9 +105,11 @@ public partial class Server case NotificationConnector.NotificationConnectorType.Ntfy: if(!requestParameters.TryGetValue("url", out url)) return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'url' missing."); - if(!requestParameters.TryGetValue("auth", out string? auth)) - return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'auth' missing."); - Ntfy ntfy = new(this, url, auth); + if(!requestParameters.TryGetValue("username", out string? username)) + return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'username' missing."); + if(!requestParameters.TryGetValue("password", out string? password)) + return new ValueTuple(HttpStatusCode.NotAcceptable, "Parameter 'password' missing."); + Ntfy ntfy = new(this, url, username, password, null); ntfy.SendNotification("Tranga Test", "It was successful :3"); return new ValueTuple(HttpStatusCode.OK, ntfy); default: diff --git a/docs/API_Calls_v2.md b/docs/API_Calls_v2.md index 545e1d4..3ff8924 100644 --- a/docs/API_Calls_v2.md +++ b/docs/API_Calls_v2.md @@ -950,7 +950,8 @@ Creates a Notification-Connector of the specified Type. | Parameter | Value | |-----------|--------------------------| | url | URL of the Ntfy Instance | - | auth | Auth-String | + | username | Username | + | password | Password |