Beginning with the Telligent Evolution platform REST/SDK 5.5.2 release, we've made building and adding your own custom endpoints to your Telligent Evolution site much easier. The CustomEndpoint project in the platform SDK provides a complete end-to-end example of a custom endpoint from registering the routes, the controller, the actions, registering the actions and implementation for the LIST, SHOW, CREATE, UPDATE and DELETE actions.

Besides creating the code for your controller and actions (covered in the SDK article about the CustomEndpoint example project), several additional steps are required to register your custom endpoint(s) with the REST pipeline:

Register your routes

See Adding custom routes.

Register your controller/actions

To register your custom controller/actions, you have to create an action registrar class that implements IRegisterActions (in the CommunityServer.Rest.Infrastructure.Dispatch namespace). IRegisterActions requires implementation of one method, RegisterActions, that accepts an IActionRegistry parameter. In the body of the method, you want to tell the IActionRegistry which assemblies to scan for your REST controllers and actions that implement IController and RestRequest. In most cases, calling registry.RegisterAllActionsIn(GetType().Assembly), registering the current assembly will be sufficient. In other cases, you may want to register controllers in other assemblies, too. The CustomEndpoint example project in the platform SDK provides an example of a custom IRegisterActions class.

Mapping IRegisterRoutes to your custom route registrar

See Adding Custom Routes.

Mapping IRegisterActions to your custom action registrar

Once you've finished creating your custom action registrar, you'll need to let the system know that your assembly contains an action registrar. You do that by adding an entry to RestModule.config file that maps CommunityServer.Rest.Infrastructure.Dispatch.IRegisterActions to your class. See the existing entry for the Telligent.Rest.CustomEndpoint.FooActionRegistrar in your RestModule.config file for an example.

Add the mapping and drop your custom assembly into your Web site's bin folder.

You may need to restart your site (IIS restart, stop/start the site, or bump the web.config file) before your routing and controller changes have an effect.

If you are using the REST console, you can view your routes in the route drop-down list. Click the Get button beside the route drop-down list and the list will then be filled with all the routes that have been registered. Routes are listed alphabetically by the resource name. You should be able to scroll down and see your new routes. You can then test your new controller and actions using the REST console.