I search in google and here but I got weird case.
I need to make an API, what get data from another service where I paste links to my API.
Links should be that:
1: https://myAPI/xxx/xxxx/optincallbackurl.php?email=$email$&key=sha1($email$security_parameter)
2: https://myAPI/xxx/xxxx/optincallbackurl.php?email=$email$&key=sha1($email$security_parameter)
Service in 2 options send me an email. How receive this data? Normal POST method API in c# should work for that callback?
CodePudding user response:
I ask for advice how to make receiver from URI, I resolve my problem code below.
public class Kontakt
{
public string kEmail { get; set; }
}
public class optoutcallbackurlController : ApiController
{
public void Post([FromUri]string email)
{
Kontakt kontakt = new Kontakt();
kontakt.kEmail = email;
}
}
Now I got link like myAPI/conroler?email="[email protected]" and I receive email from URI to my API.