Recent searches
No recent searches
Making requests to the Zendesk API
Posted Mar 17, 2021
This is a continuing discussion about the article Making requests to the Zendesk API in the developer documentation.
0
10
Recent searches
No recent searches
Posted Mar 17, 2021
This is a continuing discussion about the article Making requests to the Zendesk API in the developer documentation.
0
10 comments
Kevin Lamenzo
Could use some help translating a Help Center create attachment request from CURL into Python. Speficially, the -F tags in the CURL statement are throwing me off. I also tried GETing and attachment, then recreating the JSON object returned as my payload for the post, but I'm getting back a 500 error.
I took my subdomain, usr/pass out of the snippets below.
CURL:
Python (I copied the example above to create a ticket and tweaked it for posting an article attachment in HC):
0
Deron Fuller
I thought I would add a comment for anyone doing this from an Ubuntu (or other linux distro) where you more than likely have 2 versions of python. To get the 'requests' library for python3 this is what I did:
The instructions here indicate to just use pip, but if you're system does have 2 versions, you'll need to use pip3 to work with python3.
0
Daniel Pawluk
@Kevin,
Here is a gist I created that should help you with the python. Let me know how it works for you.
0
Charles Nadeau
Hi Jaimin,
You can combine the info in the article about searching tickets with Python with the API doc on searching the Help Center. The Python is the same in both cases -- just the query parameters and response attributes are different.
How to search with Python (tickets example) -
https://help.zendesk.com/hc/en-us/articles/229136927-Searching-with-the-Zendesk-API#python
HC search API
https://developer.zendesk.com/rest_api/docs/help_center/search
Charles
0
Jaimin Patel
Is there any way to query article (Help Center) docs using python? Sample/example documentation would be helpful.
0
Tomasz Czarny
Hello 👋 Zendesk Community! I am new to the Zendesk API and could use your help. For whatever reason I continue to receive a 401 error when I try to authenticate to our sandbox account. I have tried authenticating both using an API token and the email and password method. Both are enabled in Zendesk.
In my instance I am trying to pull down the user data via request.get. Can anyone spot what's going on? I've even tried to copy paste the python example in this article and modify where necessary...
Thanks in advance!
0
Bryan Flynn
Hi Tomasz -- since this is a sandbox instance, users (and related info such as passwords, etc) would need to be recreated in the sandbox. Sandboxes are completely separate instances than the "production" instance. Perhaps this particular user and password are different in the sandbox?? Just guessing here.
If the user and password are accurate for the sandbox instance, please submit a ticket to support@zendesk.com. It may require more details and access to your account that just can't be done over a community conversation. Thanks!
0
Ajay S Nair
How can i connect to zendesk chat api using python???
0
Bryan Flynn
Hello @....
How you call Chat REST APIs in Python would be similar to the approach mentioned above.
You'll notice, however, that Zendesk Chat APIs are prefixed with https://www.zopim.com -- there is no account subdomain like there is when calling Zendesk Support APIs.
To make API calls, you'll need to generate a Chat OAuth access token and pass that along with your API call in an Authorization header.
Check out these links for more details:
OAuth access token
OAuth authentication
Chat API tutorial: Generating an OAuth token
0
Bryan Flynn
Hi Gil. In general to make API calls, successfully accessing the API admin page at Admin > Channels/API in Zendesk Support is needed to make sure there are no issues and the account is ready to accept API calls. Two of the three ways of authenticating an API call also require "Password enabled" turned on from that page (see How can I authenticate API requests?). There's no way around these.
I'm not sure if that answers the question. If not, reply back with the API that you're calling and the exact approach you're taking to authenticate. Also, feel free to contact Zendesk Customer Support. There may be more account specific things that need to be considered to get you going, too.
0