Hi All,
I did a test application for sending SMS using the TELNYX platform. Share it in case is of use for someone.
TELNYX CURL API;
curl -X POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{
"from": "+13115552368",
"to": "+13115552367",
"text": "Hello, world!"
}' \
https://api.telnyx.com/v2/messages I created a window process and place a post button. The following is the code in the post button;
net.SetAllHeadersDefault()
do options
net.SetValue('Testdata', '{{ "from": "+18660000000", "to": "+10000000000", "text": "Hello, world!" }',net:NoUrlEncode,'','')
Testdata.SetValue('{{ "from": "+18660000000", "to": "+10000000000", "text": "TELNYX TEST " }' )
net.Authorization = 'Bearer KEY01...'
Net.Post('
https://api.telnyx.com/v2/messages',Testdata.GetValue())
This is the code in the options routine;
Net.HTTPVersion ='HTTP/1.0'
net.ContentType ='application/json'
Net.Accept_ ='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*'
Net.CanUseProxy =0
Net.ProxyServer =''
Net.ProxyPort =0
Net.OptionsDontUseSSLOverHTTPProxy =0
Net.ProxyAuthorization =''
Net.Pragma_ =''
Net.CacheControl =''
Net.Cookie =''
Net.CustomHeader =''
Net.AsyncOpenTimeOut =1200
Net.InActiveTimeout =9000
Net.HeaderOnly =0
Net.Referer =''
Net.OptionDontRedirect =0
Net.OptionAutoCookie =0
Net.OptionDontSetCookieOnRedirect =0
Net.Authorization ='Bearer KEY01...'
Net.SSLCertificateOptions.CertificateFile =''
Net.SSLCertificateOptions.PrivateKeyFile =''
Net.SSLCertificateOptions.DontVerifyRemoteCertificateCommonName =1
Net.SSLCertificateOptions.DontVerifyRemoteCertificateWithCARoot =1
Net.SSLCertificateOptions.CARootFile =''
Net.SSLCertificateOptions.ServerName =''
Net.SSLCertificateOptions.CiphersAllowed =''
Net.SSLMethod ='-5'
Probably there must be an option to set to include spanish characters as I placed various (?,?) and the messages wasn't delivered.
I hope this code help others interested in using the TELNYX SMS platform.
Cheers.