How to user registered restRoutes urls

public void Register(IRestEndpointController restRoutes)
{
restRoutes.Add(2, "baaccp/getstate/{stateId}", new { }, null, HttpMethod.Get, GetState);
}

above is my snip code. I am trying to add rest routes and trying to Ajax call on create user page. As per My understanding I am unable to call Ajax. But may be this route register will be alternate way. If yes Please tell me How I can use in .vm. 

Parents
  • First, ensure that this plugin is compiled, deployed to your site, and enabled in administration.

    This should create an endpoint at /api.ashx/v2/baaccp/getstate/{stateId} with no limitations on what {stateId} can be set to (could be any string) and the GetState method will be called to process the request.

    If the plugin is deployed and enabled and the API call is correct, what error do you receive when attempting to call this API?

Reply
  • First, ensure that this plugin is compiled, deployed to your site, and enabled in administration.

    This should create an endpoint at /api.ashx/v2/baaccp/getstate/{stateId} with no limitations on what {stateId} can be set to (could be any string) and the GetState method will be called to process the request.

    If the plugin is deployed and enabled and the API call is correct, what error do you receive when attempting to call this API?

Children