OTP not been able to generate

Hi all,

I am trying to create an OTP in my R shiny application. I would like to verify the same and then proceed ahead. I have written a function for the same-

 send_otp<- function (mobile, smsmessage)
             {
               
               username='XXXXX'
               password='XXXXXXXX'
               from='XXXXXX'
               category='bulk'
               api_params=paste0("?username=",username,"&password=",password,"&to=",mobile,"&from=",from,"&text=",URLencode(smsmessage))
               smsGatewayUrl =  "http://www......."
               smsgatewaydata = paste0(smsGatewayUrl,api_params)
               url = smsgatewaydata
               c(url)
             }
             
             rndno =floor(runif(1, min=1000, max= 9999))
             smsmessage=c('Your verification code is ',rndno')

and calling it-

 send_otp(mobile, smsmessage)

But still not getting any otp number.
How can I do the same.?