zenpy icon indicating copy to clipboard operation
zenpy copied to clipboard

Support chat api

Open drorbar opened this issue 7 years ago • 11 comments

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

drorbar avatar Mar 11 '17 14:03 drorbar

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 avatar Mar 11 '17 15:03 facetoe

@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

drorbar avatar Mar 12 '17 08:03 drorbar

+1 for this functionality.

philsalesses avatar Mar 16 '17 19:03 philsalesses

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 avatar Apr 28 '17 18:04 facetoe

@facetoe Thank you very much, this is great 👍

drorbar avatar Apr 30 '17 10:04 drorbar

No worries!

facetoe avatar May 01 '17 05:05 facetoe

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

jhrs21 avatar May 02 '17 14:05 jhrs21

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 avatar May 02 '17 14:05 facetoe

@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!

SeventhHelix avatar May 12 '17 00:05 SeventhHelix

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.

facetoe avatar May 12 '17 05:05 facetoe

Hi @SeventhHelix, I've pushed a new version to PyPi.

facetoe avatar May 15 '17 14:05 facetoe

Arrivaderla issue, seems as if some code made it in and we're "happy"

cryptomail avatar Sep 17 '23 04:09 cryptomail