caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
673 stars 61 forks source link

Sending text file attachment using JSON #208

Open ilium007 opened 2 months ago

ilium007 commented 2 months ago

:question: Question Is sending attachments using JSON supported? I want to send a text file (log file) using the JSON POST method. I have tried base64 encoding the file but can't get it to work.

ilium007 commented 2 months ago

I can send attachments using curl POST URL string in a shell scrip as a testt:

send_alert () {
  /usr/bin/curl -X POST \
    -F "title=$1" \
    -F "body=$2" \
    -F "attach=@$LOG_FILE" \
    $APPRISE_URL
}

Can this be done by sending a JSON string instead?