Modify Insert Query for Kentico REST

Refell Jones asked on December 11, 2019 15:51

I am inserting data into a customtable using Angular into the backend by hitting the API:

I want to modify the insert operation so that it checks for a particular string in one of the columns and replaces it with NULL.

Could you tell me where I could find this insert code so I can modify it?

Correct Answer

Brenden Kehren answered on December 11, 2019 16:04

The REST API is baked into the Kentico API so you't won't be able to change it. Your best solution would be to create a custom event handler for the custom table item's insert event.

2 votesVote for this answer Unmark Correct answer

Recent Answers

Roman Hutnyk answered on December 11, 2019 18:31

I agree with Brenden. In addition you might modify InfoProvider generated for your custom table to do so.

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on December 11, 2019 18:50

Actually you would be much better off creating your own webapi2 project or similar api project to handle the requests, we do this all the time instead of relying on the built in REST API (its pretty dated and does not do a good job of updating more than one specific object at a time). Have that API project connect to the Kentico dll's and you can then have total freedom to have your API do what you need it to and use standard, modern techniques (especially around security).

3 votesVote for this answer Mark as a Correct answer

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