RESTful Services not returning as expected

Brenden Kehren asked on August 5, 2014 07:08

I'm using RESTful services to get some documents back from particular node in the content tree and it's not returning the results as I'd expect. Below is my URL

http://localhost:4/rest/content/currentsite/defaultculture/childrenof/resources?offset=10&maxrecords=10

I want to get all the docs of type "x" below the /resources node and enable paging. No matter what I try, I always get every record back under the /resources node. What simple piece am I missing or what have I misread?

Correct Answer

Brenden Kehren answered on August 12, 2014 13:36

Response back from Kentico:

Our developers have sent me an update. Documents will not support offset and maxrecords, only the topn parameter. This is due to backward compatibility. The documentation will be updated.

I am very sorry for the confusion.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Jim Spillane answered on August 6, 2014 20:52

Hi Brenden. I tried using offset and maxrecords and could not get them to work (v8.0.18). Have you had any luck with it?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 6, 2014 21:45

No luck Jim. Thanks for testing as well. I've submitted a ticket to Kentico and they are looking into if its a bug or if I have something wrong in my syntax. Believe I'm using v8.0.16

0 votesVote for this answer Mark as a Correct answer

Jim Spillane answered on August 6, 2014 23:07

I also tested orderby, columns, and topn. They worked as expected.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 8, 2014 18:19

Possibly a bug. Here's the response from Kentico Support:

Based on first investigations, it seems that DocumentRESTService needs to be updated to use DataQuery internally to make this work.

0 votesVote for this answer Mark as a Correct answer

Reza Zareian Fard answered on September 19, 2014 04:34

Then how we can achieve pagination on documents?! is it possible to get the cms.document type with our custom fields instead of rest/content/currentsite/? I mean something like rest/cms.document/all?classnames=cms.news&columns=title ?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 21, 2014 17:24

@Reza, I ended up creating a custom handler to do what I needed. I'm unsure of your method as I gave up after Support stated it wouldn't work.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.