Skip to content

Customize WebApi

iJungleboy edited this page Jan 17, 2017 · 1 revision

Overview To Customizing the C# WebApi

Basically the save happens in the /api/FormController.cs, which is a standard C# / DNN / 2sxc WebAPI controller. By default it will

  1. Check Recaptcha if enabled
  2. Save the data into the content-type specified
  3. Send the e-mail to the owner using the specified e-mail Razor template, and CC it to various people
  4. Send the e-mail to the customer using the specified e-mail Razor template, and CC it to various people

Reprogramming The Default WebApi

You can simply do this, using standard C#. Just have fun. In general we recommend that you create an own WebApi instead, so that you still have the original functionality if you want to review it.

Create Additional WebApi

Just copy the FormController.cs and call it something like QuestionController.cs. Now do whatever you want :).

To test your WebApi, just specify it in the field Webservice - once everything works, you can also make it your default, by changing the App Setting DefaultWebservice which normally is Form/ProcessForm

Clone this wiki locally