-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the api support ntfy file attachments? #157
Comments
Try this: curl -X POST \
-F 'urls=ntfy://details ' \
-F 'body=test message' \
-F attach=@Screenshot-1.png \
http://localhost:8000/notify If you've saved your configuration in the API, then: curl -X POST \
-F 'body=test message' \
-F attach=@Screenshot-1.png \
http://localhost:8000/notify/{key}/ |
I haven't heard back in a while, so i'm closing off this ticket |
Hi @caronc and first off, thanks for building this brilliant project and the ongoing development. |
Hi @flinthamm, The markdown feature i hadn't realized it even existed, so I plan to solve this one, no worries here. As for the attachments not working from the testing API, I'll give it a look and keep you posted. I'll reopen this ticket. |
@flinthamm I merged the As per the second issue with Attachments:
Can you share with me what you may be doing differently? I can't seem to reproduce your issue. |
Hi @caronc I recently discovered Apprise and it's an amazing tool, thanks for creating this. I'm trying the same problem using curl, to send an attachment. The way shown above really works. However, the problem is when using curl with urls specifically (I haven't tried it with files, as I don't think I will need it) Using this command does not work: curl -X POST -F 'urls=ntfy://ntfy.mydomain.tld/test123' \
-F 'title=test title' \
-F 'body=test body' \
-F attach=https://raw.githubusercontent.com/walkxcode/dashboard-icons/0eaf38572d4b8a2485228eb5da98d356ca47f653/svg/uptime-kuma.svg \
"https://appr.mydomain.tld/notify/" the result is: Now if I use the cli with docker it works correctly: docker container exec -it apprise-api apprise --body="Test Message" \
apprises://appr.domain.tld/apprise/?tags=all \
--attach=https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png I also tried with json , the result is that the message still does not appear: curl -X POST -d '{"body":"Test message","title":"Test Title", "attach": "https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png "}' \
-H "Content-Type: application/json" \
"https://appr.domain.tld/notify/apprise?tags=all" |
So upon investigating this more, i think the issue is the confusion around the word However, when using # Using -F (it doesn't matter what it's called); this works:
curl -X POST \
-F 'body=test message' \
-F attach=@Screenshot-1.png \
"https://appr.domain.tld/notify/apprise?tags=all"
# This does too:
curl -X POST \
-F 'body=test message' \
-F file=@Screenshot-1.png \
"https://appr.domain.tld/notify/apprise?tags=all"
# and this does to; the thing is the @ with curl takes that variable and creates a new
# file/type section of the payload. In the below, only `body` gets pass
curl -X POST \
-F 'body=test message' \
-F anything=@Screenshot-1.png \
-F another=@Screenshot-2.png \
"https://appr.domain.tld/notify/apprise?tags=all" Now... when just passing using the API Payload, you must use # JSON Version
curl -X POST -d '{"body":"Test message","title":"Test Title", "attachment": "https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png "}' \
-H "Content-Type: application/json" \
"https://appr.domain.tld/notify/apprise?tags=all"
# Form Version
curl -X POST \
-F 'body=test message' \
-F 'attachment=https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png' \
http://localhost:8000/notify/{key}/ Let me know if this helps 🚀 |
I'm adding an Edit: use |
Thanks for the example, I must have missed this information in the documentation. It's working perfectly, thank you. |
Great, closing this ticket off as complete |
❓ Question
I looked through the documentation for ntfy on apprise and it appears that you are supposed to pass attach to get an image from a url. When calling the API, I can't seem to get it to work.
Here is an example curl
The text was updated successfully, but these errors were encountered: