Recent searches
No recent searches
Incremental Chats Download --> Start_Time
Posted Mar 30, 2021
Hi
I'm using the below to retrieve chats however I'm getting data in 2018 when i'm specifying 1609462861 which is 2021. What am I doing wrong?
https://www.zopim.com/api/v2/incremental/chats?fields=chats(id,chat_id,started_by,agent_id,assigned,accepted,rating,comment,timestamp,duration)?start_time=1609462861 -v -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxx
Regards
Brian
0
17
17 comments
Jean-Charles Pascale
Hi Brian,
when entering a second parameter, you have yo use a & to indicate that a second parameter is in the URL, not a "?".
Your start_time is therefore currently being ignored.
Could you try with:
https://www.zopim.com/api/v2/incremental/chats?fields=chats(id,chat_id,started_by,agent_id,assigned,accepted,rating,comment,timestamp,duration)&start_time=1609462861
Please let me know if that helped.
0
AlertService
Hey Jean
Thanks for getting back to me however I had no luck. Changed the '?' to '&' and received the below... start_time is not a recognized as an internal or external command.
Looking forward to your help.
Regards
Brian
0
Jean-Charles Pascale
Hi Brian,

That is odd, as it seems to be working for me:
Are you certain that your command is correct?
Could you give it a try in Postman?
The call says "unauthorized", are you an administrator on the account?
Thank you in advance.
Kind Regards,
-JC
0
AlertService
Hi Jean
We seem to be making progress!
The error I got is 'Method not allowed'. I am an Admin. In fact I am already downloading Agents, End Users, Agent Timelines and Tickets... using the same account.
0
Jean-Charles Pascale
Hi Brian,
Could you please make sure that you are using a GET request?
Please feel free to include the Endpoint in the screenshot if needed.
Kind Regards,
-JC
0
AlertService
Hi Jean
Ok should have mentioned this however I'm using the CURL for all downloads...
C:\Curl\curl.exe https://www.zopim.com/api/v2/incremental/chats?fields=chats(id,chat_id,started_by,agent_id,assigned,accepted,rating,comment,timestamp,duration)&start_time=1609462861 -v -H "Authorization: Bearer dnT8xeFyTLJ6bxxxxxxxxxxxxx" > D:\Configuration\Zendesk\ChatsData.json
0
Jean-Charles Pascale
Hi Brian,
I understand, but I just wanted to check that the endpoint was working properly via Postman.
Did the call work via Postman with a GET method?
Or do you get another error message?
-JC
0
AlertService
Hi Jean
Ok sorry for this. Changed to GET.
It's giving me unauthorized now when I'm an Admin. Can I check any permissions?
Thanks for all your help!
0
Jean-Charles Pascale
Hi Brian,
Thank you for this.
I see you are getting an Unauthorized 401. This error appears when the authentication is simply wrong.
If it was correct, but with the wrong rights (for instance, you are an simple Agent trying to use an Admin endpoint), the error would be a Forbidden 403.
Could you please double-check the authentication for this call? Do you calls that were working previously with this authentication still work?
-JC
0
AlertService
Hi Jean
I'm using the same authentication method to retrieve the Agent Time Line data. That works fine. It's running on production in fact. However I noticed that if I paste the Agent Time Line into Postman to test using the GET command, I'm getting the same error! 'Unauthorized'. Very strange because this works if I execute in the command prompt. I'm not sure about postman now...
I'm also using this authentication method for the agent list.
Can I send you the exact authentication which I'm using - "Authorization: Bearer dnT8xeFyTLJ6bHDqPddZJH3Lbxxxxxxx" so you will have the full command or it's useless sending that over?
I'm lost at this stage now.
Thanks for your continuous help.
0
Jean-Charles Pascale
Hi Brian,
Thank you the update.
It would be against our policy for you to share with me the Authorization token, but thank you for the offer.
From your update, I guess that the way you entered the authentication in Postman might be wrong, so let's double check this
Could you, in Postman, make sure that you selected "Bearer Token" for Authentication:
If this still does not work, could you select "No Authentication", and manually add the Authorization header, like you would with curl?
Thank you for the tests.
-JC
0
AlertService
Hi Jean
I feel so stupid! I'm not familiar with Postman and did not know that I need to enter the "Bearer Token" Authentication in the Authorization tab. I was just pasting the whole URL. It worked in Postman:) You can see the screenshot.
I selected the GET method, pasted the URL and in the Authorization tab I entered the Bearer Token.
I also noted that the timestamp is 2021 as expected.
So I just need this to work in CURL.
Thanks again a lot for your help.
0
Jean-Charles Pascale
Hi Brian,
Glad to hear it is working!
0
AlertService
Hi Jean
It worked in Postman however I have NO LUCK in curl. Sorry!
The authentication works in Postman however supplying it as a CURL command it's still giving me this error.
Regards
Brian
0
Jean-Charles Pascale
Hi Brian,
The error message seems to be pointing to your executable file and the arguments it is expecting rather than to the API, so it is starting to get out of our scope of support.
Could you simply use the "curl" command instead of your file?
0
AlertService
Hello Jean
C:\Curl\curl.exe https://www.zopim.com/api/v2/incremental/chats?fields=chats(id,chat_id,started_by,agent_id,assigned,accepted,rating,comment,timestamp,duration)&start_time=1609462861 -v -H "Authorization: Bearer xxxxxxxx"
Is this what you mean? I did not specify the output. Still same error!
I am using the Curl command for a number of other APIs, the agent_timeline being one of them, apart from tickets, users etc.
Regards
Brian
0
Jean-Charles Pascale
Hi Brian,
Sorry, I did not realize that you were using curl on Windows.
Anyway, the error message "start_time is not recognized as an internal or external command" makes me think that the command is not interpreted properly.
There is no reason as to why the start_time is interpreted as a command.
This however confirms that the issue is the syntax you are using with curl. So this is getting out of our support scope, especially since we confirmed with Postman that the API worked as intended.
I would invite you to attempt to trace the calls that you are making with this command, and see if the endpoint you are hitting is the expected one, which I suspect isn't.
0