Account balance in Human readable format

callerid
Gandalf 2021-03-04 18:57:12 +01:00
parent 3771439131
commit 4b49b97318
1 changed files with 5 additions and 1 deletions

View File

@ -1 +1,5 @@
curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/balance" -s | jq
BAL=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/balance" -s)
AMOUNT=$(echo $BAL | jq '.amount')
CUR=$(echo $BAL | jq '.currency' | sed -e 's:"::g' )
AMOUNT=$(echo "scale=2; $AMOUNT/10000" | bc -l)
echo $CUR $AMOUNT