apprise-api icon indicating copy to clipboard operation
apprise-api copied to clipboard

click url not being passed through apprise

Open fregapple opened this issue 2 months ago • 5 comments

So I have setup a config file similar to this:

urls:
  - ntfy://ntfy:80/topic:
    -  tag: <myTag>
  - bark://bark-server:8080/<key>
    - tag: <myTag>

I was hoping to pass on from a payload:

{
  "title": "some title",
  "subtitle": "some subtitle",
  "click": "click url",
  "icon": "custom icon".
  "tag": "myTag"
}

through http://apprise:8000/notify/ to the configs urls.

https://github.com/caronc/apprise/wiki/Notify_bark

Here you have mentioned the parameters allowed are click which then converts the payload to "url" for bark. But it doesn't seem to work?

if I set the url in the config to:

bark://bark-server:8080/<key>/?url=<url link>

Then the notification works fine with the click link. However, that is hardcoded and I want the link to be dynamic so in the payload would be best.

Also, not sure why icon can't be supported as well?

So far to get around the icon part, in the config file I have:

 bark://bark-server:8080/<key>/?icon=<link to icon>

This allows the icon to be shown. I am sure we could just provide the icon parameter ourself (if we can in the payload) otherwise it just defaults to the apprise icon as it does now.

fregapple avatar Nov 14 '25 05:11 fregapple

Further looking.

Apprise().notify() is where it would need to add the extra parameters.

Is there a way we could have extra args dynamically filled here? Even if it is just the full payload?

We could then use the views.py NotifyView() and just pass the icon / click link / etc to the a_obj?

fregapple avatar Nov 14 '25 09:11 fregapple

Bark supports all of the URLs, but beyond the body/title, they can not be dynamically filled, no. What you can do is pre-create some default bark configurations and uniquely identify them with a tag. When you Notify Apprise, you can just trigger the bark:// entry to use based on the tag... ie:

urls:
  - bark://bark-server:8080/key
    - tag: c-alert
      category: alert
      icon: http://example.ca/alert.jpg
    - tag: c-success
      category: woot
      icon: http://example.ca/success.jpg

Each sub item you create under a defined URL generates a copy. The above actually generates 2 Apprise URLs. Each have a different tag.

You can trigger them now:

# With Apprise:
apprise -vvv --body="There are donut's in the front hall if anyone wants any" \
   apprise://apprise-api-host:8000/{KEY}/?tags=c-success

# Or with curl (tag the other):
curl -X POST \
    -F "title=We got an issue" \
    -F "body=Grandma is cooking again..." \
    -F "tags=c-alert" \
    "http://apprise-api-host:8000/notify/{KEY}"

Let me know if this helps

caronc avatar Nov 15 '25 17:11 caronc

I see!

I have already configured quite a big list in the config file of various alternate icons.

However, the main reason I wanted to pass through a dynamic click link was so I could utilize overseer. I can dynamically send the payload to apprise with a link that refers to the webpage the notification refers too EG TV series page. But yeah if apprise doesn't create a payload with a click link to then pass onto the other services, then it obviously isn't going to work!

I can instead just use the bark-server I am hosting directly. However, it means I only send to the 1 client. Wanted to utilize this app to send to multiple clients over bark / ntfy.

That being said, it isn't a huge issue. Don't really need the click link. Just thought it would be a neat addition.

fregapple avatar Nov 16 '25 04:11 fregapple

I mean you can post the URL directly to Apprise API instead of the tag to pre-configured entries. Then your URL can be as dynamic as you want it to be (since you have to assemble it each time). See Stateless Solution

caronc avatar Nov 16 '25 14:11 caronc

I see what you mean and I'll give that a go.

Though it would make /notify/ powerful and a hub with the config file if we could pass all parameters across.

Then you can have everything setup in a config rather than sporadically across various applications.

fregapple avatar Nov 16 '25 21:11 fregapple