Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Tcl Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Tcl) Send SMS Messages via Route Mobile's SMSPlus REST API

Demonstrates how to use the Route Mobile SMSPLUS Bulk HTTP API.

Chilkat Tcl Extension Downloads

Chilkat Tcl Extension Downloads

load ./chilkat.dll

#  This requires the Chilkat API to have been previously unlocked.
#  See Global Unlock Sample for sample code.

set req [new_CkHttpRequest]

CkHttpRequest_put_Path $req "/bulksms/bulksms"
CkHttpRequest_AddParam $req "username" "YOUR_USERNAME"
CkHttpRequest_AddParam $req "password" "YOUR_PASSWORD"

#  Indicate the type of message.
#  Values for type include:
#  0: Plain text (GSM 3.38 Character encoding)
#  1: Flash (GSM 3.38 Character encoding)
#  2: Unicode
#  3: Reserved
#  4: WAP Push
#  5: Plain text (ISO-8859-1 Character encoding)
#  6: Unicode Flash
#  7: Flash (ISO-8859-1 Character encoding)
CkHttpRequest_AddParam $req "type" "0"

#  destination is the Mobile number to which the message is to be sent
#  (may or may not include a plus [+] sign).
#  Multiple mobile numbers can be separated by commas (,)
#  No need to URL encode strings passed to AddParam.
#  Chilkat will automatically URL encode when the request is sent.
CkHttpRequest_AddParam $req "destination" "+14155551234"

#  Specify the source address that should appear in the message.
#  Max Length of 18 if numeric.
#  Max Length of 11 if alphanumeric. To prefix the plus sign (+) to the senders address 

#  when the message is displayed on their cell phone, please prefix the plus sign
#  to your senders address while submitting the message 

CkHttpRequest_AddParam $req "source" "+14155558999"

#  Add the message itself.  (No URL encoding needed.)
CkHttpRequest_AddParam $req "message" "Test Message"

set http [new_CkHttp]

# resp is a CkHttpResponse
set resp [CkHttp_PostUrlEncoded $http "http://api.rmlconnect.net/bulksms/bulksms" $req]
if {[expr [CkHttp_get_LastMethodSuccess $http] != 1]} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttpRequest $req
    delete_CkHttp $http
    exit
}

#  Examine the response status code and the response body:
puts "response status code = [CkHttpResponse_get_StatusCode $resp]"
puts "response body:"
puts [CkHttpResponse_bodyStr $resp]

delete_CkHttpResponse $resp


delete_CkHttpRequest $req
delete_CkHttp $http

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.