[Help Center API] List Sections Not Returning Empty Sections (while browser list them with the same endpoint) | Community
Skip to main content

[Help Center API] List Sections Not Returning Empty Sections (while browser list them with the same endpoint)

  • March 10, 2022
  • 6 replies
  • 0 views

Pavol11

Dear team, 

I am creating/listing sections via API. Then, I also need empty sections — they however as not listed.

* I am following https://developer.zendesk.com/api-reference/help_center/help-center-api/sections/#list-sections
* I am using the following endpoint

https://<foobar>.zendesk.com/api/v2/help_center/en-us/sections.json


* Using the same endpoint, empty sections are listed in a browser — they are not returned via API call

 

* Once I manually add a single dummy article inside of an empty section — it gets returned — also in a payload requested in an API. Is there a way I could get all of the sections listed, empty ones?

Thank you! Kind regards, 

Pavol

 

6 replies

Tipene
  • March 15, 2022
Hi Pavol,
 
Thanks for reaching out! Empty sections are only visible to users with permission level Admin or above. You'll need to have someone with these permissions make the call to the API, or have someone grant you these permissions. Here's an article which goes in to a bit more detail:
I hope this helps! Feel free to reach out with any questions.
 
Tipene

Pavol11
  • Author
  • March 18, 2022

Thanks! That's super helpful :)


Pavol11
  • Author
  • March 18, 2022

I have another question. Is there any latency between the creation of an empty section and it being accessible via API in sections.json? I've elevated my users and now I can access empty ones, but still cannot see the I've just created. Thanks!


Tipene
  • March 18, 2022
Happy to help! 
 
Yes, there is a period of indexing time that can introduce latency between creation of the resource and its accessibility via the API. It generally shouldn't exceed a few seconds, but in rare circumstances it could reach a minutes or two depending on other variables.

Pavol11
  • Author
  • March 22, 2022

Hi Tipene, 

so I waited and waited and the new section did not show. Then I noticed that at the end of the page opened in the browser is a link to another page as well as `per_page` query string that can extend the size of the returned batch. 

> Most Help Center list requests return 30 records per page by default when using offset pagination:

https://developer.zendesk.com/api-reference/ticketing/introduction/#using-offset-pagination

My new section was the 31st so it appeared only on the next page. It shows up immediately with

https://<foobar>.zendesk.com/api/v2/help_center/en-us/sections.json?per_page=100

Tipene
  • March 22, 2022
Hey Pavol,
 
Ahh yes, that's correct! I should have pointed that out to save you waiting for it to appear. Glad you've now got visibility via the API now :)