zenpy
zenpy copied to clipboard
Support chat api
Hi,
Like I said in the previous messages I am using zenpy to get data from zendesk application. One of the data information I would want to get is the zendesk API (https://developer.zendesk.com/rest_api/docs/chat/introduction), which as I saw isn't supported in zenpy. I wanted to ask if you are planning to add support to this API and if not, could you please give a few quick guidelines about the right way to do it?
Thanks a lot
Hi @drorbar,
I wasn't planning on it but from a quick scan of the docs it looks like it can be integrated easily enough. I do have a chunk of time coming up where I could implement this functionality but it won't be for at least a a month. If you can't wait that long I'm happy to answer any questions you might have about implementing this feature. In fact, I was thinking of writing a contributors guide to assist people wanting to contribute to the project so this would be a good opportunity to get started!
@facetoe, adding a short contributors guide will be great! I think that I can wait a month or so, if this changes I'll probably return with a few questions
+1 for this functionality.
Hi @drorbar, @philsalesses,
I've added support for most Chat API endpoints. The only exception is the Realtime Chat API endpoint as it appears to be broken on Zendesk's end. I've opened a ticket with them and hopefully I can get that added soon.
Let me know if you find any issues. I used a trial account to implement the functionality and it is likely that there are some bugs lurking around. It also required a pretty major refactor as the Chat API does not follow the same format as the rest of the Zendesk API.
I haven't written any documentation yet but everything is exposed under zenpy_client.chats
. So for example to iterate over all chats you would do:
for chat in zenpy_client.chats():
print(chat)
Or to iterate over agents:
for agent in zenpy_client.chats.agents():
print(agent)
I had quite a bit of trouble with the API randomly dying and returning 500 errors. I have a ticket open with them for this issue also, but I would recommend testing on a test account and not a production one! Several of the accounts I used while implementing this are seemingly permanently dead...
Anyway, let me know if you have any issues!
@facetoe Thank you very much, this is great 👍
No worries!
Hello @facetoe
Great work have you done!
Do you know when this feature will be available over a version number, so pip users can update it?
Thanks
Hi @jhrs21, yep I'll be pushing a new version to PyPi in the next couple of days, I just need to write some docs and it's good to go.
@facetoe any update on when you'll be pushing the next version to PyPi? I don't mean to rush you, but I'd love to use the views
API for a project of mine.
Thanks for all your hard work on zenpy!
I'll push a new version as soon as I can get get my laptop working. unfortunately I've hit a weird bug and cannot mount my LUKS partition... this is complicated by the fact I'm riding a motorbike around Vietnam! I hope to get this sorted within a week.
Hi @SeventhHelix, I've pushed a new version to PyPi.
Arrivaderla issue, seems as if some code made it in and we're "happy"