libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 8c15ef1de61e9c6a49961a3d7fae95f5efbef6ac
parent 7d925f01be038ea194ddd110c94e9d9321033bbd
Author: MS <ms@taler.net>
Date:   Thu, 19 Jan 2023 14:56:36 +0100

SMS authorization script.

Adjusting the AUthorization header format.

Diffstat:
Mcontrib/libeufin-tan-sms.sh | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/contrib/libeufin-tan-sms.sh b/contrib/libeufin-tan-sms.sh @@ -1,21 +1,22 @@ #!/bin/sh # This file is in the public domain. + set -eu -. telesign-secrets -# Set AUTH_TOKEN=... + +. telesign-secrets # need to be found in the PATH +# Set CUSTOMER_ID and API_KEY MESSAGE=`cat -` TMPFILE=`mktemp /tmp/sms-loggingXXXXXX` + STATUS=$(curl --request POST \ + --user "$CUSTOMER_ID:$API_KEY" \ --url https://rest-api.telesign.com/v1/messaging \ - --header 'authorization: Basic $AUTH_TOKEN' \ - --header 'content-type: application/x-www-form-urlencoded' \ - --data account_livecycle_event=transact \ + --data "message_type=OTP" \ --data "message=$MESSAGE" \ - --data message_type=OTP \ --data "phone_number=$1" \ -w "%{http_code}" -s -o $TMPFILE) -echo `cat $TMPFILE` >> /var/log/sms.log +echo `cat $TMPFILE` >> $HOME/sms.log rm -f $TMPFILE case $STATUS in 200|203|250|290|291|295)