Rest API to get Custom JSON data

Manmath Kulkarni asked on August 31, 2017 10:04

Hi,

Is there any REST API that can be used to get JSON data from Kentico.

I want to Get the list of pages from Kentico in JSON format. This API should be accessible over link. e.g http://mySite.com/getjson

On calling this API, custom class will create latest list of pages and serve as a json.

Is this possble in Kentico?

Thanks in advance,
Manmath

Recent Answers


Peter Mogilnitski answered on August 31, 2017 10:53

There is ready to use REST API. You may try something like this:

~/rest/cms.document/currentsite?format=json

1 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on August 31, 2017 14:09 (last edited on August 31, 2017 14:16)

Yes Manmath there is. However you need to setup up some basic authorization/authentication for it to work. Peter's link is guiding you that how you can pass your object names to get this data. This way is pretty straightforward and help you build a REST API without writing any code. The only code you will have to write is for authorization

The other way which I like is tocreate a WCF service and use Kentico Providers to fetch any data.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on September 14, 2017 17:27

Hi Manmath,

In case you want to see the standard REST service in action, I actually walked through starting up (initial configuration) the REST service in Kentico in a recent blog post about building a chat bot that communicates with the Kentico REST features.

Hope that helps

Brian

0 votesVote for this answer Mark as a Correct answer

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