def METHOD_NAME(self, request, format=None):
    if not request.user.admin_permissions.other_permission():
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    new_ip = request.data.get('ipaddress')
    ip_obj, created = TrustedIP.objects.get_or_create(new_ip)
    if created:
        return Response(ip_obj.to_dict(), status=status.HTTP_201_CREATED)
    else:
        error_msg = "IP address %s already exists" % new_ip
        return api_error(status.HTTP_400_BAD_REQUEST, error_msg)