def parse_api_error(response):
    """
    Parse the error-message from the API Response.
    Assumes, that a check if there is an error present was done beforehand.

    :param response: Dict of the request response ([imdata][0][....])
    :type response: ``dict``
    :returns: Parsed Error-Text
    :rtype: ``str``
    """
    if "error" in response["imdata"][0]:
        return (
            "API-Errorcode "
            + str(response["imdata"][0]["error"]["attributes"]["code"])
            + ": "
            + str(response["imdata"][0]["error"]["attributes"]["text"])
        )
    else:
        return "Unparseable: " + str(response)