Prowl API TCPClient Request [resolved]

Hi there, I’m interested in sending an API request to Prowl, an iPhone notification service. I’m having difficulty understanding what my header file that I’d send via tcp client would look like, I understand how to make the request but adding parameters is where I’m stuck, could anyone help please?

Hi @rickpbush,

I’m guessing the Prowl API request is a HTTP request. There’s a great thread happening here with an HTTP Client library for just those sorts of requests!


1 Like

Ah brilliant, thank you so much :slight_smile:

Ok, anyone else wanting to do this it really is as simple as I thought it should be :

for the spark core do this :
TCPClient client; if (client.connect("", 80))     {         Serial.println(F("Command connected"));         client.write("POST application=SOMETHING%20HERE&event=EVENT%20NAME&description=THE%20EVENT%20DESCRIPTION%20HERE&priority=1&url= HTTP/1.1\r\nHost:\r\nContent Type: application/x-www-form-urlencoded\r\n\r\n");         client.stop();     }
and for the arduino do the same but use a tcp client object of your choice.


It’s interesting that they allow you to POST to /add and allow you to pass all the variables via the URL querystring. Usually all those need to go down in the body of the request instead of the URL. Glad it works that way since it makes it a little easier!


First off, I just want to say thanks for this rickpbush. Just an FYI. I ran into an issue with this after Prowl did some sever maintenance on 2016 03 13. I modified the code slightly and it is again working. See below.

client.connect("", 80)
CharsWrote = client.println(“GET /publicapi/add? apikey=SecretKey&application=AppName&event=EVENTID%20Message&description=DESCRIPTION&priority=PRORITYLEVEL&url=REFSITE HTTP/1.1\r\nHost:\r\n”)

this also works

client.connect("", 80)
CharsWrote = client.println(“POST /publicapi/add? apikey=SecretKey&application=AppName&event=EVENTID%20Message&description=DESCRIPTION&priority=PRORITYLEVEL&url=REFSITE HTTP/1.1\r\nHost:\r\n”)

I tried to use your example in a modified WebClient example. Filled in all parameters like apikey, application, event and so on. I get connected to but no further reaction. Adding a notification on the Prowl Site works perfect. Could i ask you to help me and send me a small example which i could use with my apices.

i added a var like this: int CharsWrote = client.println("POST
and it returns a number with chars written. So i thought it should work. But no sign of work.

Are you using a photon or the older spark core? I have found that the old firmware of the spark core does not support this method. If you are using a photon what is the value returned from client.println, i.e., “CharsWrote”.