From 4942f24344d2f59722f74da41f5c4629fff31a46 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Wed, 10 Mar 2021 17:11:38 +0100 Subject: [PATCH] Comments for last commit --- fax.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fax.sh b/fax.sh index 903c299..7dae98a 100755 --- a/fax.sh +++ b/fax.sh @@ -22,9 +22,11 @@ then echo "Encoding failed" exit 2 fi -echo '{"faxlineId":"f0", "recipient":"'${REC}'", "filename":"fax.pdf", "base64Content":"'${CONTENT}'"}' > $BASEPATH/.data.txt +#save payload to tempfile to prevent curl from throwing 'argument list too long' error. +echo '{"faxlineId":"f0", "recipient":"'${REC}'", "filename":"fax.pdf", "base64Content":"'${CONTENT}'"}' > $BASEPATH/.data.txt #Send fax FAXID=$(curl --request POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" --data @data.txt "https://api.sipgate.com/v2/sessions/fax" -s | jq '.sessionId' | sed -e 's:"::g' ) +#remove tempfile rm $BASEPATH/.data.txt if [ -z $FAXID ] then