Solved

Last Activity when grabbing questions from API

  • 7 July 2020
  • 1 reply
  • 241 views

Hi folks, this is related to this endpoint: https://api2-eu-west-1.insided.com/docs/community/#operation/getQuestion

 

I’ve been ingesting the data using lastActivityAt and noticed that the answer doesn’t affect this attribute. So, if my lastActivityAt is "2017-04-10T18:29:06+00:00" (example on the documentation) but my best answer is set on "2017-04-11T18:29:06+00:00", for example (anytime after the lastActivityAt timestamp), this won’t update at all. Meaning that we either ingest ALL the questions every day or we will lose answers. Is this a bug? Or expected behaviour? I always assume that lastActivityAt helps understanding SCD2 changes and that answer would be one of those due to the unpredictability of when an answer is marked as correct.

 

Thank you!

Cat

icon

Best answer by Julian 3 August 2020, 12:20

View original

1 reply

Userlevel 2
Badge +3

Hi Cat,

first of all apologies that it took so long - I am not an expert on api and I needed to chase a colleague for the right information on this.

As you have noticed, the lastActivityAt is not affected at all by a reply being marked as the answer - the reply itself is the last activity here.

What you need to do in order to get the answer, is to set a webhook for this event:

question.Answered

With this you will be able to track when there are new answers available. You can find the whole list of events here.

Hope this will help!

Reply