Activity logs API only shows today's activities

Hello, everyone, I was playing around with the activity_logs request in the API, but for some reason, it appears to return activity logs from today. I tried to set the “from” and “to” parameters to contain a wider time range, but it never returns logs else than today.

Does anybody else have the same issue and/or know how it could be fixed?

I was attempting to build a simple dashboard widget that would tell me which days I’ve been active, but as no activity logs from previous are shown through the API (it does show them when looking manually on the board’s activity log), I really don’t know how to retrieve that info.

Thanks in advance!
Fernando

Hey @Ferapagar!

The activity logs object should be able to return all activity logs on the board. Can you please share the exact query you’re sending (with the wider timerange) so we can take a look?

I just tried this query on a board and it returned all the logs before Oct 20th:

{
  boards (ids:1810493195) {
    activity_logs (to:"2021-10-20") {
      id
      created_at
    }
  }
}

Hi, @dipro!

This is the query I was using:

query{
  boards (ids:["ids here"]){

  activity_logs(user_ids:"my id" to:"2021-08-29"){
      data
      entity
      created_at
    }
   
  } 
}

It’s just so strange that I tell it to only pull updates before august 29th and it still outputs today’s logs, three days after august 29

Hey, I just realized the problem:
I was using the monday API through javascript, and tried to parse the integers from created_at using the Date() object built into the browser.
It turns out that the number needs to be first divided by 10,000, or else it will see the input as incorrect and return the current date.

Thank you so much for your support anyways

PS: Why would it be 10,000? From other APIs and native date functions, problems usually arise from counting (or not) the milliseconds. But this would mean to scale by 1,000, right?

Hey @Ferapagar – so glad you figured it out!

I’m not sure if there’s a specific rationale behind the level of precision of these timestamps.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.