Abhijeet | 2020-05-26 22:22:10 UTC | #1
Hi,
I am using below query and endpoint in my python code using requests module.
query='''{ "interval": "'''+str(strsdate)+'''.000Z/'''+str(stredate)+'''.000Z",
"order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": '''+str(number)+''' } }'''
logger.info(query) response=requests.post('https://api.mypurecloud.com/api/v2/analytics/conversations/details/query',headers=requestHeaders,data=query)
I iterate through pages using while loop and read each page data, However I am experiencing duplicate data in my target in some cases.
am I doing something wrong or do i need to mention some addition parameter? how log the page size can be? can i assign 100 instead of 25 so that i dont need to iterate the result.
Thanks,
Abhijeet Hivarkar
tim.smith | 2020-05-26 22:23:59 UTC | #2
Are you including the current time in your query interval? Paging through results including the current time isn't recommended because the conversations may change order between requests, causing both duplicate and missing data in pages beyond the first.
Abhijeet | 2020-05-27 14:01:40 UTC | #3
Hi Tim,
Below are the three different queries I sent to api and i got one conversationid in all three requests, Request 1: '{ "interval": "2020-05-27T11:30:00.000Z/2020-05-27T12:00:00.000Z", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": 1 } }'
Request2: '{ "interval": "2020-05-27T12:00:00.000Z/2020-05-27T12:30:00.000Z", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": 1 } }'
Request3: '{ "interval": "2020-05-27T12:30:00.000Z/2020-05-27T13:00:00.000Z", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": 1 } }'
Please share your thoughts on the same.
Thanks,
Abhijeet Hivarkar
Jerome.Saint-Marc | 2020-05-27 14:15:14 UTC | #4
Hello,
See this other post - to explain how the interval in the conversation details query works: https://developer.mypurecloud.com/forum/t/interval-difference/7773/2
If the conversation you see in the 3 requests started on a day touched by the interval (i.e. 2020-05-27) and had any activity in the corresponding intervals, it will be included in the response.
Regards,
system | 2020-06-27 14:15:16 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 7884