facetoe / zenpy

Python wrapper for the Zendesk API
GNU General Public License v3.0
340 stars 162 forks source link

Unable to search all articles in a section without specifying locale #648

Open ahmedsabriz opened 1 month ago

ahmedsabriz commented 1 month ago

I would like to get all articles in a section without specifying a locale because I have some articles in en-us and other source articles in other locales which are specific to their markets.

If I use articles = client.help_center.sections.articles(section=section_id) it will return articles in en-us as the default locale. I am also unable to sideload translations.

As a temporary solutions, I changed articles method in SectionsApi from

    def articles(self, section, locale='en-us'):
        return self._query_zendesk(self.endpoint.articles,
                                   'article',
                                   id=section, locale=locale)

to

    def articles(self, section, *args, **kwargs):
        return self._query_zendesk(self.endpoint.articles,
                                   'article',
                                   id=section, *args, **kwargs)

However, it makes the sideloading solution inconsistent with primary endpoints for not accepting lists.

cryptomail commented 3 weeks ago

If you were to raise a PR that solves your issue and doesn't break other stuff, we should look at it!