I'll make some API's on my ASP.NET MVC project, but there is one API whit a PUT methode that I'll protect form all the users so that they can't access it. Only by an ajax request from my site, can acces it whit a special API key.
My idea was to make a new community user whit an API key. That key must update every day so that it can't be stolen. The community user can't login on the site. Now if that API has been called from an intern ajax request, I check if the key in the URL is equal to the API of the community user. If not I send a response that the key didn't match.
The key is a string whit 45 upper- or lowercase chars, numbers or special chars like stripes, underscores and spaces. For the site, I use HTTPS.
Is this system secure for hackers and other people that will steal it? So no, are there better ways to protect that API?