My code is in Python but you should be able to follow it regardless of which language you use.
I have successfully authenticated my user via OAuth and I can now successfully query the Who Am I API using the following command:
url = 'https://api.monzo.com/ping/whoami'
headers = {
"Authorization": "Bearer "+user.access_token,
}
r = requests.get(url, headers=headers)
I’m now trying to query the List Transactions api. But I don’t understand how exactly I should form the header to pass the account_id. This is what the Monzo documentation says:
http "https://api.monzo.com/transactions" \
"Authorization: Bearer $access_token" \
"account_id==$account_id"
This is what I’ve tried:
url = 'https://api.monzo.com/transactions'
headers = {
"Authorization": "Bearer "+user.access_token,
"account_id": account.monzo_account,
}
r = requests.get(url, headers=headers)
Looking at the Monzo documentation, the account_id header is formed differently. Notice the == sign instead of the colon below. What does this mean?
http "https://api.monzo.com/transactions" \
"Authorization: Bearer $access_token" \
"account_id==$account_id"