Recent searches


No recent searches

InvalidEndpoint using /api/v2/imports/tickets



Posted Dec 21, 2023

I want to import Tickets in sense of a migration. Using https://<domain>.zendesk.com/api/v2/imports/tickets in the browser shows following error message:

{"error":"InvalidEndpoint","description":"Not found"}

Using python code similar to the example given in the API documentation also leads to the error. Other endpoints work in this way.

import json
import requests


import_url = 'https://<domain>.zendesk.com/api/v2/imports/tickets?archive_immediately='
print(import_url)
headers = {
'Authorization': 'Basic xxx=',
'content-type': 'application/json'
}
data={"ticket":{"subject":"Ticket for Import Test","description":"This is a test ticket","requester_id":1900466156814,"submitter_id":378414422420,"assignee_id":378414422420,"organization_id":382262135560,"group_id":1900000676394}}
payload = json.dumps(data)
response = requests.put(import_url, headers=headers, data=payload)
if response.status_code == 200:
print('Done!')
else:
print('Error code: ' + str(response.status_code))
print('Error text: ' + str(response.text))

Output

Error code: 404
Error text: {"error":"InvalidEndpoint","description":"Not found"}

For Team member authentication we use Single sign-on, not Zendesk authentication. The user used in our scripts has administrator permissions as required by the API.


0

2

2 comments

Hello @...

As far as I see, you replaced package json with package 80century and the same for the content-type. I don't know this package.

Furthermore the dummy domain is replaced by the same way.

The code snippet wont work in a different instance for several reasons
- IDs for requester, submitter and so on in the data will not match your instance
- Value for Authorization is modified of course and would also only match our instance

Do you have the same issue or are you able to use this API endpoint?

Torsten

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Torsten! The reason you're having this issue is because the request method that you're using is incorrect. As you can see in our API docs, this endpoint only has the POST method available, however you're using a PUT. Could you update that and let us know if you're still having any issues?

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post