Created
November 14, 2015 15:10
-
-
Save Velrok/0f34529b67e00c11a1ba to your computer and use it in GitHub Desktop.
Dump all available mondo transactions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# yo need to set | |
# all values must be url encoded! | |
# export MONDO_EMAIL | |
# export MONDO_PASSWORD | |
# export MONDO_CLIENT_ID | |
# export MONDO_CLIENT_SECRET | |
mondo_api="https://staging-api.gmon.io" | |
token=$(curl -X POST --data "grant_type=password&client_id=$MONDO_CLIENT_ID&client_secret=$MONDO_CLIENT_SECRET&username=$MONDO_EMAIL&password=$MONDO_PASSWORD" $mondo_api/oauth2/token | jq ".access_token" | sed -e 's/"//g') | |
account_id=$(curl -H "Authorization: Bearer $token" $mondo_api/accounts | jq ".accounts[0].id" | sed -e 's/"//g') | |
curl -H "Authorization: Bearer $token" "$mondo_api/transactions?account_id=$account_id&expand\[\]=merchant" | jq "." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment