def gettaskwithlabelid(labelid, api):
    """
    Returns a list of Task IDs found with given label-ID

    :param labelid: (str) label ID of label to search for
    :param api: (obj) todoist api
    :return: (list) found Task IDs
    """
    found = []
    for task in api.state['items']:
        if not isinstance(task['id'], str) and task['labels'] and not task[
            'is_deleted'] and not task['in_history'] and not getattr(task,
            'is_archived', 0):
            for label in task['labels']:
                if label == labelid:
                    found.append(task['id'])
    return found
