facetoe / zenpy Goto Github PK
View Code? Open in Web Editor NEWPython wrapper for the Zendesk API
License: GNU General Public License v3.0
Python wrapper for the Zendesk API
License: GNU General Public License v3.0
Having this feature would be awesome! https://developer.zendesk.com/rest_api/docs/core/organizations#search-organizations-by-external-id
It would be awesome if we could do the same for end_users as well.
Hi guys,
Is there a way to get user's related information based on his name or his id like:
zenpy.search("john doe", type='user', related_information=True)
?
I would like to get users infos and his number of requested tickets or opened tickets.
Hello,
How can I get a user thanks to his email ?
zenpy.users(email="theemailadress") doesnt work. I got a resultgenerator instead of an object.
Regards
HW
Hi,
It's any way to make a mock to the tickets library?. For example, make a mock to zenpy.tickets.create function?
I make a mock, but the test not working, the call_count give me 0 value (i try with zenpy.lib.api.TicketApi.create, zenpy.lib.api.CRUDApi.create, with the same result).
Thanks
I'm trying to facilitate the work of our agents by adding a private comment to each incoming ticket, where we specify a few additional details about the requester, specific to our service. However, I can't figure out if it's possible to create a comment, either public or private, for a given ticket. Is this implemented at all? If not, any chance it will be?
Setting the logging options in https://github.com/facetoe/zenpy/blob/master/zenpy/__init__.py wreaks havoc on the logging configuration of consumers of the module. I would recommend removing the logging configuration and simply let ZenPy consumers handle it.
I think this is a bug in Zendesk as even their example returns a 403:
curl -v -u [email protected]/token:sometoken https://facetoe.zendesk.com/api/v2/users/create_or_update_many.json -H "Content-Type: application/json" -X POST -d '{"users": [{"name": "Roger Wilco", "email": "[email protected]", "role": "agent"}, {"external_id": "account_54321", "name": "Woger Rilco", "email": "[email protected]", "role": "admin"}]}'
...
> POST /api/v2/users/create_or_update_many.json HTTP/1.1
> Host: facetoe.zendesk.com
> User-Agent: curl/7.47.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 185
>
* upload completely sent off: 185 out of 185 bytes
< HTTP/1.1 403 Forbidden
Hi facetoe,
Thank you for implementing my request with issue #36. I am hoping to use the latest changes in production very soon. Is the current state of master ready for version 1.0.3? ๐
It seems that the if-elif conditions defined in SearchEndpoint don't properly handle cases when the value is a datetime object OR the value is of list type and key == ids. In order for those arguments to make it into the final query string, they can't be handled as elif conditions. They should probably be their own if conditions so that the code can fall through to assessment of the keys, and then modify renamed_kwargs.
OranizationApi vs OrganizationApi
https://github.com/facetoe/zenpy/blob/master/zenpy/lib/api.py#L547
Hi There
I have a problem where regularly my zenpy client just hangs without throwing an exception...
Here my code....
ZD_EXCEPTIONS = (
ZenpyException,
APIException,
RecordNotFoundException,
ZenpyCacheException
)
try:
usr = []
for obj in zenpy.group_memberships(timeout=0.05):
if obj.user.role == 'agent' and \
obj.user.to_dict()['user_fields']['custom_name'] is not None:
data = [
obj.user.to_dict()['user_fields']['custom_name'].replace(
'.domain.com', '').replace('-', '_'),
obj.user.id,
obj.user.email,
obj.user.organization.id,
obj.user.organization.name,
]
if data not in usr:
usr.append(data)
except ZD_EXCEPTIONS as error:
print('Problem connecting to Zendesk API. {}'.format(error))
sys.exit(1)
I assume I am hitting rate limit or something but it is not caught by the timeout either. I found this article regarding best practices on rate limit. https://support.zendesk.com/hc/en-us/articles/203691336-Best-practices-for-avoiding-rate-limiting
Any suggestions what I can do?
Many Thanks
Christoph
Version numbers of 3rd party packages are unspecified in the setup: https://github.com/facetoe/zenpy/blob/master/setup.py#L16
Issues like koalalorenzo/python-digitalocean#88 can occur because of that.
https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-user
If the client supports this, please forgive my ignorance.
I installed zenpy from source about 2 weeks ago.
it included "/objects/" subdirectory.
Today I can't find the "objects" subdir (neither in pipy nor in github).
Where did it go?
Am I missing something?
So I'm trying out zenpy for editing tickets but when I'm trying update it I receive this weird error:
>>> ticket = zend.tickets.get_ticket(38884)
>>> ticket.tags.append(u'wrapper_testing')
>>> zend.tickets.update(ticket)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xander-lubuntu/.virtualenvs/sabackend/local/lib/python2.7/site-packages/zenpy/lib/api_objects.py", line 25, in __repr__
return super().__str__()
TypeError: super() takes at least 1 argument (0 given)
It updates the ticket yes, but this is something I would not want to receive or see.
Can anyone shine a light on this thing?
https://developer.zendesk.com/rest_api/docs/core/custom_roles
Need Enterprise to test.
Great library.
I'd like to set a ticket form id when I create a ticket. Doesn't look like this is currently possible. Looking at https://developer.zendesk.com/rest_api/docs/core/tickets, I think it's just: ticket_form_id.
sort_order, sort_by etc
I'm following your job status
example for bulk ticket creation; however, I'm not sure how I would then update the ticket tags or ticket descriptions using the generator object. The documentation is rather sparse and does not indicate how to do this.
Can you please update the readme to provide an example on how to query or search with a sort_by parameter?
Document code with Sphinx or similar.
Hi,
First of all let me say, great module! Really helped me out. I did though find the incremental ticket metrics missing.
I opened a branch and added it myself, but I do not have permissions to publish the branch and open a pull request.
I would love for this to be added (through my PR or not), as I don't want to maintain a fork for ZenPy only for this.
Thanks,
Uri
Hi,
First and foremost, thanks for this zendesk api wrapper.
After reading through the zenpy documentation though, I am having trouble creating new users.
After logging in with my credentials:
zenpy = zenpy.Zenpy(**creds)
I can make zenpy queries on zenpy.users (etc.), but when I try to create a new user:
user = User(name='Jim', email='[email protected]')
I get the following error message:
Traceback (most recent call last):
...
user = User(name='Jim', email='[email protected]')
NameError: name 'User' is not defined
This was the example given in the documentation.
I am hesitant because I'm afraid it is an issue on my end (am I missing something?), but would like to see if anyone else has this issue since I've exhausted a lot of different options.
Thanks,
Preston
Hey!
The users endpoint does not seem to side load organizations.
https://github.com/facetoe/zenpy/blob/master/zenpy/lib/endpoint.py#L243
The http request does show the query parmater
https://test.zendesk.com/api/v2/users/1.json&include=organizations,abilities,roles,identities,groups
but I am unable to access organizations on the result, for example:
(Pdb) zendesk_user = zendesk.users(id=4727211738)
(Pdb) zendesk_user.organizations
*** AttributeError: 'User' object has no attribute 'organizations'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.