Sending PROWL Notifications

Hi Folks,
I'm trying to incorporate prowl notifications into my project. The prowl api works fine if I just paste the syntax into a browser address bar or make it part of an HTML form. I can't figure out the Arduino code for accessing the api through my program. I'm connected to my WWiFi (WiFiNINA) and I can connect to various hosts (including api.prowlapp.com), but that's as far as I get. Here's what I use as a Form Action ( /POST) to send a notification:

https://api.prowlapp.com/publicapi/add?apikey=[my api key]&priority=1&application=From: Service Dashboard&event=Time to Move&description=Tag G035 needs to come into the shop. Tag Y116 moves to Completed area.

Could someone please tell me how to send this to the prowl server directly from the Arduino? Thank you so much.

 if (client.connect(target, 80)) {

    Serial.println("connected to server");

    client.println(" < what goes here?? > ");

    client.println("Connection: close");

    client.println();

  }

The provided API URL is HTTPS but your code excerpt connects to port 80.

Good point! I changed it to 443 and I'll experiment some more in a little while. I was able to connect to the server on port 80 so that may be allowed as well - the documentation says to TRY to use https when possible, so... I'm struggling to figure out what to send in json format after I connect, including where to put the 'post' parameter. I tried sending this after connecting to api.prowlapp.com:

client.print("\"add\":{\"apikey\":\"myApiKey\", \"priority\":1, \"application\":\"From: Service Dashboard\", \"event\":\"Time to Move\", \"description\":\"Tag G035 needs to come into the shop. Tag Y116 moves to Completed area.\"}");

I get no response back from the server, errors or otherwise. Any ideas? Thanks again.

Post complete code, that tiny excerpt might be correct or might be wrong, we cannot tell because you're hiding the majority of the code!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.