import logging


def get_message_ids(message_list):
    """Retrieves message ids from a messages list response to be used for batch actions"""
    message_ids = []
    try:
        message_ids = [message.get('id', None) for message in message_list]
    except Exception as ex:
        logging.exception('Get Message Ids Exception: %s' % ex)
    return message_ids