Ntfy usage: Difference between revisions

From wikinotes
 
Line 7: Line 7:
   Subscribe to a topic:  # generate a name
   Subscribe to a topic:  # generate a name


# change display name of topic
# change display name of topic (you can still see the topic in the URL afterwards)
Sidebar:
Sidebar:
   Subscribed Topics:
   Subscribed Topics:

Latest revision as of 23:26, 19 May 2024

Create a Topic

From the UI

# create a topic
Sidebar:
  Subscribe to a topic:  # generate a name

# change display name of topic (you can still see the topic in the URL afterwards)
Sidebar:
  Subscribed Topics:
    - ${your_topic}:  # options

Emit to Topic

# HTTP basic auth
curl \
  -u username:password \
  -d "Hello world!" \
  https://server.com/${topic_name}

# using token
curl \
  -H "Authorization: Bearer tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" \
  -d "Hello world!" \
  https://server.com/${topic_name}