Hello @misha​ , It's not a bug.
Â
First of all, the value should be in ("-") and the second one:
More info can be found here.
Â
@roy s11​ Thanks for the reply, BUT:
1) I've tried putting value in "" and it doesn't work. Still I can't get the contact
2) As you may've noticed I've already mention the note you attached to the answer and the main reason of this question is that it doesn't work for me.
Â
Please take a look at the attached screenshots. On the second you can see that the created date is greater than queried one. And it's okay since date is interpreted as beginning of the day.
But according to that logic the query from the first screenshot should return the same contact since ">" works as greater or equal according to docs.
Â
Am I wrong here?
By the way, the date that is used in search query is equal to "Mon, 12 Oct 2020 00:00:00 GMT"
and the created_at from contact is equal to "Mon, 12 Oct 2020 08:39:40 GMT"
Â
So query
{
field: "created_at",
operator: ">",
value: "1602460800"
}
should return all contacts that were created after "Mon, 12 Oct 2020 00:00:00 GMT", Am I right?
Â
@misha​ , Sorry, missed your text I check now and "=" is even not supported for timestamps.
Â
"For example, if you search for all Contacts with a created_at value greater than 1577869200 (the UNIX timestamp for 2020-01-01 @ 09:00), that will be interpreted as 1577836800 (2020-01-01 @ 00:00). The search results will then include Contacts created between 00.00 and 09.00 on 2020-01-01."
Â
So for 2 day's result, I Take a 3-day timestamp and use the following request:
=========================================
{
 "query": {
  "operator": "AND",
  "value": l
   {
    "field": "created_at",
    "operator": ">",
    "value": "1600905600"
   },Â
   {
    "field": "created_at",
    "operator": "<",
    "value": "1601078400"
   }
  ]
 }
}
=========================================
And it's worked for me.
If you want results for 1 day, you should take from and to timestamps for that.
Sorry, but still can't fully understand the logic of how to get contacts specifically after 1602460800 :(
Â
I've just tried this query
Â
{
"query": {
"operator": "AND",
"value": :
{
"field": "created_at",
"operator": ">",
"value": "1602460800"
},
{
"field": "created_at",
"operator": "<",
"value": "1602547200"
}
]
}
}
Â
And it doesn't return items between them.
Â
It begins to work only when I use created_at from previous day, i.e. 1602460799 (11 Oct 23:59:59 GMT). So looks like ">" works here as `Greater` instead of `Greater or Equal`.
FYI: for conversations it seems to work better. Looks like '>' still works as 'greater' instead of 'greater or equal'. Please take a look at screenshots for more details.
Â
@roy s11​ sorry for disturbance but maybe you have some more tips for me?)
@misha​ , Hah, Sorry sometimes missing posts hereÂ
Â
The best way here to ask about this Intercom support from messenger or wait here until someone from the Intercom team reply to you.
Â
When I'm using a data filter with "From -> To" it's working fine.Â
Â
You are asking "Looks like '>' still works as 'greater' instead of 'greater or equal"
In Intercom documentation, cleary said:Â
Â
"This means you can only query for timestamp fields by day - not an hour, a minute, or second"
Â
That's why you are not getting exact results for "1602624758; 1602624759".Â
Â
My advice was to use date to date to get a result:Â Â
=========================================
{
 "query": {
  "operator": "AND",
  "value": Â
   {
    "field": "created_at",
    "operator": ">",
    "value": "One date"
   },Â
   {
    "field": "created_at",
    "operator": "<",
    "value": "Two date"
   }
  ]
 }
}
=========================================
If this not works in your case, you should contact Intercom support or wait the answer from an Intercom employee here.Â
Â
Sorry that I missed your post.
Hm...strange but looks like now it works as described for new contacts. But I still can't get this particular contacts using start of their day.
Â
By 'greater or equal' I meant that according to docs date in search query transforms to the start of the day '00:00' and for me it worked only when I asked the end of previous day like '23:59'.
Â
Anyway, thanks for the contribution!
@roy s11​ Hey ,
I am also facing similar kind of issue. what happened in my scenario is that is as below (API V is 2.3).
- As per docs intercom save timestamp data in UTC format
- 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
- 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 format date from ISO string to UTC timestamp.
Â
Please kindly provide help.