Hello everyone,
I’m trying to set up a form in one of our web interfaces where users can post messages that get sent as new tickets to our Zammad installation.
I have created a Zammad user for this interface, that is configured with admin and agent rights and has ‘All’ rights on all existing user groups. This user has a registered API token. I can successfully access the API and get information, for example for getting a list of user groups via the /api/v1/groups endpoint.
However I can’t figure out why a POST request against the /api/v1/tickets endpoint does not work. I’m using the python requests module for convenience to do the requests, but have managed to reproduce the problem by using cUrl commands on a shell.
This works:
curl -H "Authorization: Token token=sometokenvalue; Content-Type: application/json" -X GET http://www.example.com/api/v1/groups
where the token and the hostname have been replaced with placeholder values.
This does not work:
curl -H "Authorization: Token token=sometokenvalue; Content-Type: application/json" -X POST -d '{"title":"Help me!","group": "Users","article":{"subject":"some subject","body":"some message","type":"note","internal":false},"customer":"email_of_existing_customer@example.com","note": "some note"}' http://www.example.com/api/v1/tickets
and returns a 400 reponse with the error message “article hash is missing”.
I’m starting to think that this error message is a red herring and the actual error is somewhere else, like insufficient permissions or something.