import requests
import json


def getUserTraffic(nw_id, client_id, token):
    """Function for gathering traffic info of a specific client in a network
    Parameters:
    nw_id (string): Id for identifying a network
    client_id (string): Id for identifying a client
    token (string): Meraki Dashboard API token

    Returns:
    dict: traffic info objects
    """
    url = f"https://api.meraki.com/api/v1/networks/{nw_id}/clients/{client_id}/trafficHistory"
    payload = {}
    headers = {
        'X-Cisco-Meraki-API-Key': token
    }
    response = requests.request("GET", url, headers=headers, data=payload)
    response.raise_for_status()

    return(json.loads(response.text))