Http node get request with parameter

Hi
I am using Pushover sending post messages through the http request node which is allowing me to get the receipt parameter of an emergency message from the response. In order to determine if this message has been acknowledged I need to make a get request as outlined below.

Receipts and Callbacks API
Applications sending emergency-priority notifications will receive a receipt parameter from our API when a notification has been queued. This parameter is a 30 character string containing the character set [A-Za-z0-9]. This receipt can be used to periodically poll our receipts API to get the status of your notification, up to 1 week after your notification has been received.

Submit a GET request (no faster than once every 5 seconds) to:

https://api.pushover.net/1/receipts/(your receipt).json?token=(your app token)
Include the receipt in the URL and your application's token as the token parameter. If the receipt is valid, our API will respond with some integer-valued parameters about your notification:

I am not sure if the app token should be appended to the url or if it is somehow included as a separate parameter within the http request. I am sure the app token is correct as it is used to generate the original notifications. Just entering the parameter within the (you app token) space with or without brackets throws an invalid error.
I just get errors relating to the app token being invalid and I think I must be using the incorrect method.
It would appear that not many are using the notification acknowledge API as google searches have been fruitless.
Any guidance would be appreciated.
Thanks

According to what you have written, the receipt your receive after you send your notification request needs to replace the (your receipt), and the app token needs to replace the (your app token). This can be done in the http request node using Mustache
e.g.

https://api.pushover.net/1/receipts/{{{receipt_token}}}.json?token={{{app_token}}}

The receipt would be sent to the http request node as msg.receipt_token and the app token as msg.app_token

Example flow

[{"id":"b59c78a8881b11f6","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"receipt_token","v":"REC456hgg8krty","vt":"str"},{"p":"app_token","v":"api3654gshsjsjsjjs","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":2840,"wires":[["e31db1a3dc731a6d"]]},{"id":"e31db1a3dc731a6d","type":"http request","z":"d1395164b4eec73e","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://api.pushover.net/1/receipts/{{{receipt_token}}}.json?token={{{app_token}}}","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":2840,"wires":[["1b56d180ab143af5"]]},{"id":"1b56d180ab143af5","type":"debug","z":"d1395164b4eec73e","name":"debug 2567","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":2840,"wires":[]}]

Thanks for a quick response and a perfect solution.
Just out of interest would you have any idea why receipt which would change with every message is hard coded if thats the right phrase, into the url, but the app token which is reused is appended as a parameter? This is all new to me so thanks again for your assistance.

At a guess, when you send a notification a JSON file is created with the receipt name,. The url is the path to the file and the app token is not part of the path.

Makes sense.
Thanks

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