The API docs indicate you should be able to GET /api/v2/help_center/categories/{category_id}/articles however I can't find a way to do this in this library. I would expect to find it in $zendeskHttpClient->helpCenter->categories($category_id)->articles()->iterator() but that doesn't exist. I tried $zendeskHttpClient->helpCenter->categories($category_id)->sections()->articles()->iterator() which gives all articles.
I think Zendesk\API\Resources\HelpCenter\Articles needs to be updated with something like (I tried it and it seems to work in my case, but I don't know what I'm missing)
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter();
$params = $this->addChainedParametersToParams($params, [
'section_id' => Sections::class,
]);
if (empty($lastChained) || $name !== 'findAll') {
return $this->localesGetRoute($name, $params);
} else {
$chainedResourceName = array_keys($lastChained)[0];
$id = $lastChained[$chainedResourceName];
if ($chainedResourceName === Sections::class) {
$locales = $this->getLocale();
if ($locales) {
return "{$this->prefix}{$locales}/sections/$id/articles.json";
} else {
return "{$this->prefix}sections/$id/articles.json";
}
// This block is added:
} elseif ($chainedResourceName === Categories::class) {
$locales = $this->getLocale();
if ($locales) {
return "{$this->prefix}{$locales}/categories/$id/articles.json";
} else {
return "{$this->prefix}categories/$id/articles.json";
}
} else {
return $this->localesGetRoute($name, $params);
}
}
}
The API docs indicate you should be able to
GET /api/v2/help_center/categories/{category_id}/articleshowever I can't find a way to do this in this library. I would expect to find it in$zendeskHttpClient->helpCenter->categories($category_id)->articles()->iterator()but that doesn't exist. I tried$zendeskHttpClient->helpCenter->categories($category_id)->sections()->articles()->iterator()which gives all articles.I think
Zendesk\API\Resources\HelpCenter\Articlesneeds to be updated with something like (I tried it and it seems to work in my case, but I don't know what I'm missing)