2

I am able to get first page Knowledge Articles using REST API.

https://XXXX.my.salesforce.com/services/data/v44.0/support/knowledgeArticles

The result has articles for page 1

"currentPageUrl": "/services/data/v44.0/support/knowledgeArticles",

"nextPageUrl": "/services/data/v44.0/support/knowledgeArticles?pageNumber=2" ....

But when I try to get articles for page 2 using the nextPageUrl above, I get {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}

Any idea how to get all the Knowledge articles?

  • How many responses are you getting back from your initial call? What happens if you set page size to 100? (https://...../services/data/v44.0/support/knowledgeArticles?pageSize=100) Does the response come back with a null nextPageUrl? – Shane Steinfeld Oct 6 '18 at 11:17
  • Hi Shane, I get 20 articles in the initial call. I know there are hundreds of articles. When I set pageSize=100, I get {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}. Thanks! – Bindu Oct 7 '18 at 12:21
  • Hmm. That's strange. What if you set the page size to something less than 20? Just want to make sure we're doing that part right first. – Shane Steinfeld Oct 7 '18 at 13:27
  • I get the same error for page size 5 {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"} – Bindu Oct 8 '18 at 12:05
  • Shane, the issue was with URIBuilder I am using. builder.setPath("/services/data/v44.0/support/knowledgeArticles"); builder.addParameter("pageSize", "10"); works. The following did not work builder.setPath("/services/data/v44.0/support/knowledgeArticles?pageSize=10"); I am all set. Thanks for your response. – Bindu Oct 8 '18 at 13:02
0

The issue was with org.apache.http.client.utils.URIBuilder I am using.

The following works builder.setPath("/services/data/v44.0/support/knowledgeArticles"); builder.addParameter("pageSize", "10");

The following did not work builder.setPath("/services/data/v44.0/support/knowledgeArticles?pageSize=10");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.