timeRange absolute 400 Bad Request

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

timeRange absolute 400 Bad Request

L3 Networker

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

1 accepted solution

Accepted Solutions

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

2 REPLIES 2

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?

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

  • 1 accepted solution
  • 5320 Views
  • 2 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!