mirror of
https://github.com/cwinfo/envayasms.git
synced 2025-01-10 04:05:38 +00:00
add server api examples
This commit is contained in:
parent
c4502447a6
commit
4d3350b3fd
@ -93,7 +93,7 @@ The following HTTP Headers are sent in all POST requests from KalSMS:
|
||||
<li>the password,</li>
|
||||
</ul>
|
||||
with a comma in between each element, like so:
|
||||
<br /><br />
|
||||
<br />
|
||||
<code>"<serverURL>,<name1>,<value1>,<...>,<nameN>,<valueN>,<password>"</code>
|
||||
</li>
|
||||
|
||||
@ -192,6 +192,51 @@ Additional parameters sent in POST requests with action=send_status:
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Example request for incoming SMS message:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: sAemG31uRllk/K9xck2WRNaF/WI=
|
||||
Content-Length: 96
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
from=6505551234&message_type=sms&message=test&version=2&phone_number=16505551212&action=incoming
|
||||
</pre>
|
||||
|
||||
Example request for incoming MMS message:
|
||||
|
||||
<pre>
|
||||
TODO
|
||||
</pre>
|
||||
|
||||
Example request for checking for outgoing SMS messages:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: 139CL71b7r1Zw/E2wcccWFviSlg=
|
||||
Content-Length: 50
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
action=outgoing&version=2&phone_number=16505551212
|
||||
</pre>
|
||||
|
||||
Example request for notifying status of sent message:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: 6uJtI6+QqlVBbUsR4T0WsQomods=
|
||||
Content-Length: 80
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
id=1536&status=sent&error=&action=send_status&version=2&phone_number=16505551212
|
||||
</pre>
|
||||
|
||||
<h3>
|
||||
HTTP Response Format
|
||||
</h4>
|
||||
@ -247,14 +292,18 @@ The Content-Type header should be text/xml, with the content as follows:
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Example:
|
||||
Example response:
|
||||
|
||||
<pre>
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<messages>
|
||||
<sms id='42' to='5551212'>Message One</sms>
|
||||
<sms>Message Two</sms>
|
||||
</message>
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/xml
|
||||
Content-Length: 189
|
||||
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<messages>
|
||||
<sms id='1540' to='16505551213'>This is a test</sms>
|
||||
<sms id='1541' to='16505551214'>This is a another test message.</sms>
|
||||
</messages>
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
|
@ -55,7 +55,9 @@ h3 { color: #678bf0; }
|
||||
a { color: #678bf0; }
|
||||
.description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
|
||||
.download { float: right; }
|
||||
pre { background: #000; color: #fff; padding: 15px;}
|
||||
pre {
|
||||
background: #eee; color: #333; padding: 5px;
|
||||
}
|
||||
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
|
||||
.footer { text-align:center; padding-top:30px; font-style: italic; }
|
||||
|
||||
|
@ -123,7 +123,7 @@ The following HTTP Headers are sent in all POST requests from KalSMS:
|
||||
<li>the password,</li>
|
||||
</ul>
|
||||
with a comma in between each element, like so:
|
||||
<br /><br />
|
||||
<br />
|
||||
<code>"<serverURL>,<name1>,<value1>,<...>,<nameN>,<valueN>,<password>"</code>
|
||||
</li>
|
||||
|
||||
@ -222,6 +222,51 @@ Additional parameters sent in POST requests with action=send_status:
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Example request for incoming SMS message:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: sAemG31uRllk/K9xck2WRNaF/WI=
|
||||
Content-Length: 96
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
from=6505551234&message_type=sms&message=test&version=2&phone_number=16505551212&action=incoming
|
||||
</pre>
|
||||
|
||||
Example request for incoming MMS message:
|
||||
|
||||
<pre>
|
||||
TODO
|
||||
</pre>
|
||||
|
||||
Example request for checking for outgoing SMS messages:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: 139CL71b7r1Zw/E2wcccWFviSlg=
|
||||
Content-Length: 50
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
action=outgoing&version=2&phone_number=16505551212
|
||||
</pre>
|
||||
|
||||
Example request for notifying status of sent message:
|
||||
|
||||
<pre>
|
||||
POST /sg/kalsms HTTP/1.1
|
||||
X-Kalsms-Signature: 6uJtI6+QqlVBbUsR4T0WsQomods=
|
||||
Content-Length: 80
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Host: 192.168.70.1:3000
|
||||
Connection: Keep-Alive
|
||||
|
||||
id=1536&status=sent&error=&action=send_status&version=2&phone_number=16505551212
|
||||
</pre>
|
||||
|
||||
<h3>
|
||||
HTTP Response Format
|
||||
</h4>
|
||||
@ -277,14 +322,18 @@ The Content-Type header should be text/xml, with the content as follows:
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Example:
|
||||
Example response:
|
||||
|
||||
<pre>
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<messages>
|
||||
<sms id='42' to='5551212'>Message One</sms>
|
||||
<sms>Message Two</sms>
|
||||
</message>
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/xml
|
||||
Content-Length: 189
|
||||
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<messages>
|
||||
<sms id='1540' to='16505551213'>This is a test</sms>
|
||||
<sms id='1541' to='16505551214'>This is a another test message.</sms>
|
||||
</messages>
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
|
@ -55,7 +55,9 @@ h3 { color: #678bf0; }
|
||||
a { color: #678bf0; }
|
||||
.description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
|
||||
.download { float: right; }
|
||||
pre { background: #000; color: #fff; padding: 15px;}
|
||||
pre {
|
||||
background: #eee; color: #333; padding: 5px;
|
||||
}
|
||||
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
|
||||
.footer { text-align:center; padding-top:30px; font-style: italic; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user