User filtering by multiple roles no longer working over support API
답변함
2022년 8월 16일에 게시됨
For a few months now we've been filtering incoming users on the GET https://{{tenant}.zendesk.com/api/v2/users call by role[]=agent&role[]=admin to sort end-users out of the data we receive. This has stopped working since then. I've tested this filter not just on our access management platform but through Postman and the thunder client extension for VS code as well.
Sorting by individual roles in separate calls still works but accommodating this would require functionality development for us. Was asked to post this here by the support team. Curious if it's known that this filter is broken or if others are effected.
0
5
댓글 5개
Greg Katechis
I'm not sure, I was just asking one of my colleagues the same and we were scratching our heads on that. I reached out to the team that owns this endpoint, I'll drop you a line when I hear back.
0
Joe Bogash
Wow. That sure does fix it. Interesting. Just out of curiosity, were there any recent changes that would have caused it to fail? I had it worked the old way for 4 or 5 months now.
0
Greg Katechis
Hi Joe! I did some testing here and checked our logs and I think I found the issue. It looks like before you're sending the request to us, it's getting URL encoded...but only after the page parameter that you're passing in. So the way it's hitting us is like this: `/api/v2/users.json?page[size]=100&role%5B%5D%3Dadmin%26role%5B%5D%3Dagent`. I tested this by URL encoding all parameters and instead got the error at the page, which confirms the behavior that I'm seeing.
Could you try passing this in as such and let us know if that works for you? `/api/v2/users?page[size]=100&role[]=admin&role[]=agent`
1
Joe Bogash
Provided below is the error it throws for us:
[ InvalidRequestException ] [ Error details ] Invalid request received to Zendesk System. Status: 400, Output: { "error": { "title": "Invalid attribute", "message": "You passed an invalid value for the role attribute. Invalid parameter: role must be a string from api/v2/users/index" } }
As far as why I was asked to post here I got:
"This particular request we'd like to refer you to join our developer community via Forum (https://support.zendesk.com/hc/en-us/community/topics) , Blog (https://developerblog.zendesk.com/) or even Slack (https://docs.google.com/forms/d/e/1FAIpQLScm_rDLWwzWnq6PpYWFOR_PwMaSBcaFft-1pYornQtBGAaiJA/viewform). This would be outside the scope of support for our general advocacy."
0
Sebastiaan (Sparkly ⭐)
Hey Joe,
We're using the filter on this endpoint in many of ours apps. So I was a bit worried when I read this, but after some testing I can't reproduce this issue on our development and testing instances. These are on POD17 and POD20.
What's the problem you're experiencing? Does it not filter at all, give an error, show only one of the roles, or something else?
I wonder why support asked you to post this here, normally they direct you here if it's a feature request or so. Did they elaborate on that?
(Just to be sure; I'm a community moderator. I don't work for Zendesk.)
0
로그인하세요.