mirror of
https://github.com/cwinfo/envayasms.git
synced 2024-11-14 20:30:26 +00:00
reorganize server api reference
This commit is contained in:
parent
aa7f0279b4
commit
a0c11a9c77
@ -21,8 +21,57 @@ We encourage you to contribute new libraries and example code back to the KalSMS
|
|||||||
HTTP Request Format
|
HTTP Request Format
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
<h4>Example requests</h4>
|
||||||
|
|
||||||
|
<p>An incoming SMS from <code>6505551234</code> with message body "test":</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<p>An incoming MMS message:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
TODO
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>Checking for outgoing SMS messages:</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<p>Notifying the server of the status of a sent message:</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<h4>Specification</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The following parameters are sent by all POST requests from KalSMS:
|
The following parameters are sent in all POST requests from KalSMS:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
@ -192,51 +241,6 @@ Additional parameters sent in POST requests with action=send_status:
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</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>
|
<h3>
|
||||||
HTTP Response Format
|
HTTP Response Format
|
||||||
</h4>
|
</h4>
|
||||||
@ -247,10 +251,25 @@ If the signature check failed, the server should return status code 403.
|
|||||||
Other status codes may be used to signify errors.
|
Other status codes may be used to signify errors.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
HTTP response format for action=incoming and action=outgoing:
|
<h4>HTTP response for action=incoming and action=outgoing</h4>
|
||||||
<blockquote>
|
|
||||||
The Content-Type header should be text/xml, with the content as follows:
|
|
||||||
|
|
||||||
|
Example:
|
||||||
|
<pre>
|
||||||
|
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>
|
||||||
|
|
||||||
|
Specification:
|
||||||
|
<p>
|
||||||
|
The Content-Type header should be text/xml, with the content as follows:
|
||||||
|
</p>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><messages></dt>
|
<dt><messages></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -259,6 +278,7 @@ The Content-Type header should be text/xml, with the content as follows:
|
|||||||
<br />
|
<br />
|
||||||
Attributes:
|
Attributes:
|
||||||
<dl><dt>none</dt></dl>
|
<dl><dt>none</dt></dl>
|
||||||
|
<br />
|
||||||
Content:
|
Content:
|
||||||
<dl>
|
<dl>
|
||||||
<dt><sms>*</dt>
|
<dt><sms>*</dt>
|
||||||
@ -283,32 +303,19 @@ The Content-Type header should be text/xml, with the content as follows:
|
|||||||
sender.
|
sender.
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<br />
|
||||||
Content:
|
Content:
|
||||||
<dl>
|
<dl>
|
||||||
<dt>CDATA</dt>
|
<dt>CDATA</dt>
|
||||||
<dd>
|
<dd>
|
||||||
The content of the SMS message to send.
|
The content of the SMS message to send.
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
Example response:
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
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>
|
|
||||||
|
|
||||||
Response format for action=send_status:
|
<h4>HTTP Response for action=send_status</h4>
|
||||||
|
|
||||||
<blockquote>
|
<p>
|
||||||
The response content is currently undefined and ignored.
|
The response content is currently undefined and ignored.
|
||||||
</blockquote>
|
</p>
|
||||||
|
141
serverapi.html
141
serverapi.html
@ -53,8 +53,57 @@ We encourage you to contribute new libraries and example code back to the KalSMS
|
|||||||
HTTP Request Format
|
HTTP Request Format
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
<h4>Example requests</h4>
|
||||||
|
|
||||||
|
<p>An incoming SMS from <code>6505551234</code> with message body "test":</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<p>An incoming MMS message:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
TODO
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>Checking for outgoing SMS messages:</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<p>Notifying the server of the status of a sent message:</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<h4>Specification</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The following parameters are sent by all POST requests from KalSMS:
|
The following parameters are sent in all POST requests from KalSMS:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
@ -224,51 +273,6 @@ Additional parameters sent in POST requests with action=send_status:
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</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>
|
<h3>
|
||||||
HTTP Response Format
|
HTTP Response Format
|
||||||
</h4>
|
</h4>
|
||||||
@ -279,10 +283,25 @@ If the signature check failed, the server should return status code 403.
|
|||||||
Other status codes may be used to signify errors.
|
Other status codes may be used to signify errors.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
HTTP response format for action=incoming and action=outgoing:
|
<h4>HTTP response for action=incoming and action=outgoing</h4>
|
||||||
<blockquote>
|
|
||||||
The Content-Type header should be text/xml, with the content as follows:
|
|
||||||
|
|
||||||
|
Example:
|
||||||
|
<pre>
|
||||||
|
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>
|
||||||
|
|
||||||
|
Specification:
|
||||||
|
<p>
|
||||||
|
The Content-Type header should be text/xml, with the content as follows:
|
||||||
|
</p>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><messages></dt>
|
<dt><messages></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -291,6 +310,7 @@ The Content-Type header should be text/xml, with the content as follows:
|
|||||||
<br />
|
<br />
|
||||||
Attributes:
|
Attributes:
|
||||||
<dl><dt>none</dt></dl>
|
<dl><dt>none</dt></dl>
|
||||||
|
<br />
|
||||||
Content:
|
Content:
|
||||||
<dl>
|
<dl>
|
||||||
<dt><sms>*</dt>
|
<dt><sms>*</dt>
|
||||||
@ -315,35 +335,22 @@ The Content-Type header should be text/xml, with the content as follows:
|
|||||||
sender.
|
sender.
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<br />
|
||||||
Content:
|
Content:
|
||||||
<dl>
|
<dl>
|
||||||
<dt>CDATA</dt>
|
<dt>CDATA</dt>
|
||||||
<dd>
|
<dd>
|
||||||
The content of the SMS message to send.
|
The content of the SMS message to send.
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
Example response:
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
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>
|
|
||||||
|
|
||||||
Response format for action=send_status:
|
<h4>HTTP Response for action=send_status</h4>
|
||||||
|
|
||||||
<blockquote>
|
<p>
|
||||||
The response content is currently undefined and ignored.
|
The response content is currently undefined and ignored.
|
||||||
</blockquote>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
Loading…
Reference in New Issue
Block a user