Now Reading
Ship push notifications to your cellphone by way of PUT/POST

Ship push notifications to your cellphone by way of PUT/POST

2022-11-08 05:00:56

ntfy (pronounce: notify) is a straightforward HTTP-based pub-sub notification service.
It permits you to ship notifications to your cellphone or desktop by way of scripts from any laptop,
completely with out signup, price or setup. It is also open source if you wish to run your individual.

Publishing messages

Publishing messages could be completed by way of PUT or POST. Subjects are created on the fly by subscribing or publishing to them.
As a result of there isn’t a sign-up, the subject is basically a password, so decide one thing that is not simply guessable.

This is an instance displaying learn how to publish a message utilizing a POST request (by way of curl -d):


curl -d "Backup profitable ????" ntfy.sh/mytopic

There are more features associated to publishing messages: You may set a
notification priority, a title,
and tag messages.
This is an instance utilizing a few of them collectively:


curl
  -H "Title: Unauthorized entry detected"
  -H "Precedence: pressing"
  -H "Tags: warning,cranium"
  -d "Distant entry to $(hostname) detected. Act instantly."
  ntfy.sh/mytopic

This is what that appears like within the Android app:

Pressing notification with pop-over

Subscribe to a subject

You may create and subscribe to a subject both using your phone,
in this web UI, or in your individual app by subscribing via the API.

Subscribe out of your cellphone

Merely get the app and begin publishing messages. To study extra in regards to the app,
check out the documentation.



This is a video displaying the app in motion:

Subscribe by way of internet app

Subscribe to subjects within the web app and obtain messages as desktop notification.
It’s accessible at ntfy.sh/app.

ntfy internet app, accessible at ntfy.sh/app

Subscribe utilizing the API

There is a tremendous easy API that you should use to combine your individual app. You may eat
a JSON stream,
an SSE/EventSource stream,
a plain text stream,
or via WebSockets.

See Also

This is an instance for JSON. The connection stays open, so you’ll be able to retrieve messages as they arrive in:


$ curl -s ntfy.sh/mytopic/json
{"id":"SLiKI64DOt","time":1635528757,"occasion":"open","subject":"mytopic"}
{"id":"hwQ2YpKdmg","time":1635528741,"occasion":"message","subject":"mytopic","message":"Hello!"}
{"id":"DGUDShMCsc","time":1635528787,"occasion":"keepalive","subject":"mytopic"}
...

This is a brief video demonstrating it in motion:

Take a look at the docs!

ntfy has so many extra options and you may study all of them in the documentation
(I attempted my best possible to make it the perfect docs ever ????, unsure if I succeeded, hehe).

Take a look at the documentation

100% open supply & ceaselessly free

I really like free software program, and I am doing this as a result of it is enjoyable. I’ve no dangerous intentions, and I’ll
by no means monetize or promote your info. This service will at all times keep
free and open.
You may learn extra within the FAQs and within the privacy policy.

Made with ❤️ by Philipp C. Heckel

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top