11 lines
363 B
Bash
11 lines
363 B
Bash
|
|
#!/bin/bash
|
||
|
|
#set -x
|
||
|
|
mkdir -p temp
|
||
|
|
|
||
|
|
./getNewAccessToken.sh
|
||
|
|
|
||
|
|
tempFile=temp/accountPositions.tmp.$$.json
|
||
|
|
curl -s -X GET "https://api.schwabapi.com/trader/v1/accounts/?fields=positions" -H "Authorization: Bearer $(<access_token.dat)" > ${tempFile}
|
||
|
|
jq -e '{ accountNumber:.[].securitiesAccount.accountNumber, positions:.[].securitiesAccount.positions}' < ${tempFile}
|
||
|
|
|