How do I specify the following URL format in the routing and access the variables (service id, Security id, writedataflag) in the following:
https://<Domain Name or localhost<Port No>>api/<service Id>/<security id>/<writedataflag>
Configure the route template.
The following example uses Attribute Routing on a controller action.
//matches GET api/<service Id>/<security id>/<writedataflag>
[HttpGet]
[Route("api/{service_id}/{security_id}/{writedataflag}")]
public IHttpActionResult MyAction(int service_id, int security_id, string writedataflag){
//...
}
the parameter types can be changed to suit your needs. Also consider using parameter constraints.
Read more about that here