import requests


def retrieve_info(url, apidata):
    """
    Return a dictionary from the HTSworkflow API
    """
    web = requests.get(url, params=apidata)

    if web.status_code != 200:
        raise requests.HTTPError(
            "Failed to access {} error {}".format(url, web.status_code))

    result = web.json()
    if "result" in result:
        result = result["result"]
    return result