clickatell.com/http/sendmsg?api_id=xxxx&user=xxxx&password
=xxxx&to=xxxx&text=xxxx
??? ??? ??? ??? ??? ???
Sending Text Messages
[ 104 ]
You can send a test message by entering the URL in your browser and replacing
xxxx with proper values. Keep in mind that every message costs! Most gateways will
provide some free credits or discounted rates for test messages, but the meter keeps
running for every message you send! Our meter for Luigi is also running, so let us
proceed with integrating the Clickatell API into the POTR code.
We will first write a wrapper class to integrate with Clickatell. This will keep
the integration distinct from other code, and make it easier to manage changes.
Essentially, it will send GET requests and process the response. Here is how the
API works for Clickatell:
To Authenticate and Get a Session:
Command: http://api.clickatell.com/http/auth?api_id=xxxx&user=
xxxx&password=xxxx.
Response: OK: Session ID or ERR: Error number.
To Send an SMS after Authenticating:
Command: http://api.clickatell.com/http/sendmsg?session_id=xxx
x&to=xxxx&text=xxxx.
Response: ID: apimsgid or ERR: Error number
Based on this, let's write up our wrapper class.
Pages:
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147