0

I have a .net core webapi application that sends promotional sms to my users using infobip, I use the following code to send the sms using infobip nugget package:

        var infobipMessage = new InfobipAuthKeyMessageDto
        {
            Messages = new List<InfobipAuthKeyMessageDetailDto>
            {
                new InfobipAuthKeyMessageDetailDto
                {
                    From = "MyApplicaiton",                        
                    Text = "xxxxx, to subscribe, reply 1",
                    Destinations = new List<InfobipDestinationDto>
                    {
                        new InfobipDestinationDto
                        {
                            To = "SomePhoneNumber"
                        }
                    }                        
                }
            }
        };  

        var serializedInfobipMessage = JsonConvert.SerializeObject(infobipMessage);
    
        var httpRequest = new HttpRequestMessage(HttpMethod.Post, "sms/2/text/advanced");
        httpRequest.Content = new StringContent(serializedInfobipMessage, Encoding.UTF8, "application/json");

        var response = await _httpClient.SendAsync(httpRequest);

Now, when the receiver of the message replies back with "1", I need this reply to trigger an api call on my server, how can I achieve this?

mahmoudmh
  • 51
  • 1
  • 7

0 Answers0