Ticket Articles are not fetched anymore

Created on 19 September 2020, about 4 years ago
Updated 13 February 2023, almost 2 years ago

This problem might be related to a new version of Zammad 3.4.

Articles (which will be treated as comments in Drupal) are not fetched anymore. The request results in an "unauthorized" error.

You can execute the following curl:

curl -H "Authorization: Token token=<your_token>" -H "Content-Type: application/json" -H "X-On-Behalf-Of: 14" -X GET https://zammad.test.bitegra-solutions.de/api/v1/tickets/

This works fine. But if you want the corresponding articles of a ticket:

curl -H "Authorization: Token token=<your_token>" -H "Content-Type: application/json" -H "X-On-Behalf-Of: 14" -X GET https://zammad.test.bitegra-solutions.de/api/v1/ticket_articles/by_ticket/12

Result: {"error":"Not authorized","error_human":"Not authorized"}

The API token has all available permissions.

You have to leave out the On-Behalf Header.

The php client we use in Drupal, uses the same request, so it does not work there either, because we set the On-Behalf.

I think, this makes no sense in the Zammad API, if the problem is not somewhere else.

To fix this on our side, there is a function unsetOnBehalfOfUser we can call before we fetch articles. This works.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany danielspeicher Steisslingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024