Answered

1.How Intercom API handle timestamp in search query ? 2.Respnse data in array is not received in correct order for get all contact API despite mentioning order=desc key in qs.

  • 13 January 2021
  • 4 replies
  • 79 views

I am also facing weird kind of issue. what happened in my scenario is that is as below (API V is 2.3).

  1. As per docs intercom save timestamp data in UTC format
  2. when I pass the UTC timestamp to search API sometimes is does not return any result , but at the same time I pass the timestamp of my local region I got requested data . sometimes it happen vise-versa
  3. in GET All CONTACT API - when requested sometimes data come in ASC order despite mention order=DESC key in query-params

 

I am not sure what is happening at server but I am sure about date is correctly formatted from ISO string to UTC timestamp.

 

Please kindly provide help.

icon

Best answer by Roy 13 January 2021, 13:15

View original

4 replies

Userlevel 1
Badge

Hello @vidyesh​ , I will answer you here.

Q - As per docs intercom save timestamp data in UTC format

A - If you are using API, you should use Unix timestamps.

Are you passing the timestamp encoded as the Unix timestamp?

 

More about Unix Time Stamp.

More information about Dates and Timestamps from Intercom Developer docs.

@Roy sh,

thank for reply.

 

Yes i am passing timestamp in UNIX encoded format. I use moment.js to get unix timestamp.

 

I use below method get UNIX timestamp

FOR START OF DAY

moment().utc().startOf('day').unix()

 

FOR CURRENT TIMESTAMP

moment().utc().unix();

Userlevel 1
Badge

@vidyesh​ , Sorry I have a busy day, missed your post here.

 

Q- when I pass the UTC timestamp to search API sometimes is does not return any result , but at the same time I pass the timestamp of my local region I got requested data . sometimes it happen vise-versa

A - Can you post a request when you are getting an empty result?

epoche-timestamp-proof.contact-search-with-data-GMT-1@Roy sh,

Sorry got so much busy on weekend. Unable to check on post.

yes I have replicate the issue please find the screenshot above.

 

 

 

 

Reply