Version 7.x > API > Create REST service returning custom query results View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 9/27/2013 2:07:49 AM
Create REST service returning custom query results
I have some content in an external database that I would like to expose through a service defined in Kentico. I would use JSON or XML as output (CSV is not a good solution).

1. I tried using a repeater, but I couldn't find a way to avoid adding the HTML tags.
2. I tried to use the CustomResponse webpart, but I couldn't find a way to render the output of a document query with a given transformation using only K#
3. I checked the documentation of the REST service, but I couldn't find how I can return the output of a custom document query

The third approach would be the preferred one, as I can configure security and use querystring parameters.

How can I achieve such goal? Is there any way to expose such data without coding?
Many thanks
Emanuele Firmani

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 10/23/2013 7:40:01 PM
RE:Create REST service returning custom query results
Hi Emanuele,

Am I understanding correctly, that you want to implement your custom WS, and you would like to use the same authentication as is used for our REST service?

Our REST svc alone accepts neither custom queries, nor allows getting data from external DB without implementing that feature into dummy object type GetData method... what is not a simple task, although it might be possible.
Your aim is quite specific scenario and there's no built-in configurable way to achieve that, at least with the present information.

Is your request about using our REST, or just using the same kind of authentication?
Also please note, that if your queries are going to be dynamic, the hash authentication that we use for REST works only for complete URL and you have to generate it first on the server, therefore you would need to communicate with the server first to obtain the auth.hash.

All in all, there will probably always be some coding involved.
Please let me know if I can be of any further help.