Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get articles of selected section #390

Closed
LendorHR opened this issue Jun 7, 2018 · 7 comments
Closed

Can't get articles of selected section #390

LendorHR opened this issue Jun 7, 2018 · 7 comments

Comments

@LendorHR
Copy link

LendorHR commented Jun 7, 2018

This: client->helpCenter->sections(section_id)->articles()->findAll(), doesn't work. It 's returns all articles from all section and categories.
Also IDE complains that it can't find the sections() method in HelpCenter. With categories() and articles() this is not observed.

@Aplear
Copy link

Aplear commented Aug 9, 2018

Who can understand - How to do this issue? Thanks

@learntoswim
Copy link

Also just stumbled into this.

@Spittal
Copy link

Spittal commented Aug 28, 2018

+1

@ecoologic
Copy link
Collaborator

Hi,

thank you for your request,
are you still interested in a solution for this issue?

@ecoologic
Copy link
Collaborator

Closing due to inactivity. Re-open if needed.

@adnen-chouibi
Copy link

The full example to get All articles from Help Center

// load Composer
require 'vendor/autoload.php';

use Zendesk\API\HttpClient as ZendeskAPI;

$subdomain = "subdomain";
$username  = "email@example.com"; // replace this with your registered email
$token     = "6wiIBWbGkBMo1mRDMuVwkw1EPsNkeUj95PIz2akv"; // replace this with your token

$client = new ZendeskAPI($subdomain);
$client->setAuth('basic', ['username' => $username, 'token' => $token]);

//The secret ingredient
$help_center = new HelpCenter($client);
$articles =  $help_center->articles()->findAll();

Reference:

public function __construct(HttpClient $client)

@token-cjg
Copy link
Contributor

Thank you @adnen-chouibi for pinpointing the gap in the samples. I have added a contribution here: #536 and acknowledged your remark above therein.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants