timeRange absolute 400 Bad Request

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
L3 Networker

timeRange absolute 400 Bad Request

Hi,

 

Am trying to fetch alerts based upon an absolute timerange to ensure I don't continuously run into timeouts with my queries (want to get all open alerts for long running accounts that customers never looked at or that simply have way too many misconfigured resources). Whenever I execute the call I however keep running into 400 Bad Request statuses, and seem to be blind for my mistake. The call I'm trying to execute is the following:

 

 

curl -X POST \
  '<a href="https://api2.redlock.io/v2/alert?alert.status=open&detailed=true" target="_blank">https://api2.redlock.io/v2/alert?alert.status=open&detailed=true</a>' \
  -H 'Content-Type: application/json' \
  -H 'Host: api2.redlock.io' \
  -H 'x-redlock-auth: my-very-special-secret-auth-key' \
  -d '{
    "timeRange": {
        "type": "absolute",
        "value": {
            "startTime": 1572244614366,
            "endTime": 1569649014366
        }
    }
}'

 

 When attempting it with a GET request to the below URL (of course with the x-redlock-auth header set) it also returns a 400 Bad Request. When using relative time of 1 month it just works as expected.

 

<a href="https://api2.redlock.io/v2/alert?alert.status=open&timeType=absolute&startTime=1572244614366&endTime=1569649014366&detailed=true" target="_blank">https://api2.redlock.io/v2/alert?alert.status=open&timeType=absolute&startTime=1572244614366&endTime=1569649014366&detailed=true</a>

 

 

Regards


Accepted Solutions
Highlighted
L3 Networker

Your start time is Oct 28th and your end time is Sept 28th.  Have you tried flipping the values to see if it still results in a 400?

View solution in original post


All Replies
Highlighted
L3 Networker

Your start time is Oct 28th and your end time is Sept 28th.  Have you tried flipping the values to see if it still results in a 400?

View solution in original post

Highlighted
L3 Networker

Thanks @ebeuerlein! Did I mention I seemed to be blind for my own mistake?

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!