import requests


def check_for_positions(account_id, access_token):
    """Check for current positions and return them as json data."""
    
    # Get the account's current positions
    url = 'https://api.tdameritrade.com/v1/accounts/' + account_id
    headers = {
        'Authorization': 'Bearer '+ access_token,
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    params = {'fields':'positions'}
    payload = {}
    response = requests.request("GET", url, headers=headers, params=params, data=payload)
    data = response.json()
    return data