The custom search bar we added to our knowledge base is returning irrelevant search results because the tag filtering isn’t working properly. We’re using the Zendesk Sell API to fetch articles and our client-side search implementation should filter by multiple tags, but it’s not applying the filters correctly.
When users search for articles tagged with specific categories, the API request parameter formatting seems off - we’re getting all articles instead of just those matching the selected tags. The tag filter logic worked in our development environment but fails in production.
Here’s our current API call:
fetch('/api/v2/help_center/articles/search?query=' + searchTerm +
'&label_names=' + tags.join(','))
.then(response => response.json())
Our support team is frustrated because they can’t quickly find relevant articles for customer inquiries. Anyone experienced similar issues with tag-based filtering in the knowledge base API?
Have you tried testing the API call directly using Postman or curl to isolate whether it’s an API issue or a client-side implementation problem? That would help determine if the tag filter logic is the issue or if it’s the API request parameter formatting.
The development vs production difference suggests an environment configuration issue. Check if your production API credentials have the same permissions as dev. Also, zs-2023 introduced rate limiting on search endpoints that could affect how results are returned if you’re making multiple rapid requests.
I think your parameter name might be wrong. In zs-2023, the API uses ‘tags’ instead of ‘label_names’ for the search endpoint. Try changing that parameter and see if it helps. Also make sure you’re URL encoding the tag values properly.
The issue might be with how you’re joining the tags. The API expects tags to be passed as separate parameters, not comma-separated. Try using tags[]=tag1&tags[]=tag2 format instead. Also, check if your tags have spaces or special characters that need encoding. Your client-side search implementation should handle tag normalization before sending the request.