Answered

Miro Audit Logs

  • 4 February 2021
  • 2 replies
  • 45 views

I am trying to access audit logs of my team but am unable to access it as it says bad request for every request.

 

This is the request

https://api.miro.com/v1/audit/logs?createdAfter=2021-02-01T23:59:45Z&createdBefore=2021-02-05T23:59:45Z

 

I have also tried this in case it might work but it did not work too

https://api.miro.com/v1/audit/logs?createdAfter=2021-02-01&createdBefore=2021-02-05

 

I have added my authentication as Bearer {{Token}}.

 

The response I get is 400 Bad Request:

{

"status": 400,

"code": "invalidParameters",

"message": "Method arguments are not valid",

"context": {

"fields": [

{

"field": "createdAfter",

"message": "Invalid parameter type: Date is required",

"reason": "invalidParameter"

}

]

},

"type": "error"

}

 

Any help here would be appreciated. Thanks in advance!

icon

Best answer by Daniela Gavidia 8 February 2021, 14:13

Hello Abishek,

 

I believe the problem you are seeing is because the format of the date that you are passing does not match exactly with what the backed expects. Please try the format yyyy-MM-ddThh🇲🇲ss.SSSZ, as mentioned in the documentation:

https://developers.miro.com/reference#get-logs
 

Like this:

https://api.miro.com/v1/audit/logs?createdAfter=2020-02-01T05:34:08.000Z&createdBefore=2020-02-02T05:34:08.000Z

Notice the .000 between the seconds and the Z. 

 

Kind regards.

 

Daniela

View original

2 replies

Userlevel 3
Badge +6

Hello Abishek,

 

I believe the problem you are seeing is because the format of the date that you are passing does not match exactly with what the backed expects. Please try the format yyyy-MM-ddThh:mm:ss.SSSZ, as mentioned in the documentation:

https://developers.miro.com/reference#get-logs
 

Like this:

https://api.miro.com/v1/audit/logs?createdAfter=2020-02-01T05:34:08.000Z&createdBefore=2020-02-02T05:34:08.000Z

Notice the .000 between the seconds and the Z. 

 

Kind regards.

 

Daniela

Hi Daniela,

 

I tried it your way and it worked. Thank you for the help!

 

 

Reply