I currently have a lot of Web APIs that are being used by various applications. All of the APIs are using ASP.NET Web API 2 with 4.6 .NET framework. I want to be able to keep track of all the different applications that are using a specific API.
Example:
Lets say I have the following API:
- Employees API - gets all employee(s)
And I have the following applications that call the Employees API
- Employee Management System - located at
/intranet/employee/add
- Time Off Request Form - located at
/intranet/timeoff.aspx
The Employee Management System calls the Employees API using HttpClient in C# code.
The Time Off Request Form calls the Employees API using an ajax call in JavaScript.
I want to keep a log of all the applications that are using a Web API and preferably what action they are calling. What is the best way to achieve this?
Is there a way to get the Callers URI?
From the Web API is it possible to know that /intranet/timeoff.aspx
is calling the the add employee action on the Employee API