Open winteris opened 2 months ago
You can't get only the latest message using the API right now if you haven't been listening to the topic and tracking message IDs. /json?poll=1
is going to be your best option. Then just truncate the response/only look at the last line of the response
Thank you for your reply.
I think I’ve followed the route you point out, but when I use /json?poll=1
to get all available messages, I got a json.ndjson
file instead of a json string or text as the reponse., and then, I can’t parse out the message from the .ndjson
file, in iOS shortcuts APP.
I think It will more useul if I got a text
type of reponse instead of a file
one. Could it possible? Or need a feature request to move it on?
Got it finally!
If I use ntfy.sh/topic/raw?poll=1
, I’ll get a response in a text
type.
But I still wish the /json?poll=1
could support text response if it is possible.
:question: Question
I just got a file named
json.ndjson
when I start a http request in safari and other internet explorer whit this URL:ntfy.sh/stats/json?poll=1
Exactly, I just want to get the lastest json string using a get http request in iOS shortcuts, but I can’t parse out the message. Can I get a JSON string directly with the api? https://docs.ntfy.sh/examples/ Examples in docs all aresend
and there is no aget
example , can someone give me some help?