import requests


def lacrosse_get_locations(token):
    """
    Query La Crosse server to return a list of user's locations

    :param token: Current, valid token for user session -- see `lacrosse_login`
    """

    url = "https://lax-gateway.appspot.com/" \
          "_ah/api/lacrosseClient/v1.1/active-user/locations"
    headers = {"Authorization": "Bearer " + token}
    r = requests.get(url, headers=headers)
    if r.status_code < 200 or r.status_code >= 300:
        raise ConnectionError("failed to get locations ()".
                              format(r.status_code))
    body = r.json()
    return body.get('items')