(request, domain, event_id=None)
Despite it's name this API is backed by the MessagingSubEvent model
    which has a more direct relationship with who the messages are being sent to.
    Each event may have more than one actual message associated with it.
Despite it's name this API is backed by the MessagingSubEvent model
    which has a more direct relationship with who the messages are being sent to.
    Each event may have more than one actual message associated with it.
Despite it s name this API is backed by the MessagingSubEvent model which has a more direct relationship with who the messages are being sent to . Each event may have more than one actual message associated with it .
def messaging_events(request, domain, event_id=None):
    """Despite it's name this API is backed by the MessagingSubEvent model
    which has a more direct relationship with who the messages are being sent to.
    Each event may have more than one actual message associated with it.
    """
    try:
        if request.method == 'GET' and event_id:
            return _get_individual(request, event_id)
        if request.method == 'GET' and not event_id:
            return _get_list(request)
        return JsonResponse({'error': "Request method not allowed"}, status=405)
    except BadRequest as e:
        return JsonResponse({'error': str(e)}, status=400)
def messaging_events ( request , domain , event_id = None ) : try : if request . method == 'GET' and event_id : return _get_individual ( request , event_id ) if request . method == 'GET' and not event_id : return _get_list ( request ) return JsonResponse ( { 'error' : "Request method not allowed" } , status = 405 ) except BadRequest as e : return JsonResponse ( { 'error' : str ( e ) } , status = 400 )