Forum Discussion
VikasB
Boss
Kev_B
yes, start date and end date is not working here with this API. But you can do it with API V2 also.
Select * from messages where author.id = '123' and post_time > "date" and post_time < "date"
Kev_B
7 years agoAdvisor
Thanks Vikas,
I'm most interested in using the count function on posts, is there an easy way to do this with API v2?
Thanks
- PerBonomi7 years agoBoss
This is a starting point:
<#assign user_id = 123/> <#assign board_id = 'help'/> <#assign date_start = "yyyy-MM-dd"/> <#assign date_end = "yyyy-MM-dd"/> <#assign timezone = "+01:00"/> <#assign query = rest("2.0","/search?q=" + "SELECT count(*) FROM messages WHERE board.id = '${board_id}' AND author.id = '${user_id}' AND post_time >= ${date_start}T00:00:00${timezone} AND post_time <= ${date_end}T00:00:00${timezone}"?url) /> <#assign post_count = query.data.count!0/> ${post_count}
- VikasB7 years agoBoss
a) Use the same API shared in the last comment. See here https://prnt.sc/kxz7je
b) Use count specific APISelect count(*) from messages where author.id = '3' and post_time > 2018-09-21T00:15:47.369-07:00
- Kev_B7 years agoAdvisor
Great stuff, thanks both!
Related Content
- 6 months ago
- 4 years ago
- 4 years ago