diff --git a/.phrozn/entries/serverapi.twig b/.phrozn/entries/serverapi.twig index 517017f..acc30fe 100755 --- a/.phrozn/entries/serverapi.twig +++ b/.phrozn/entries/serverapi.twig @@ -93,7 +93,7 @@ The following HTTP Headers are sent in all POST requests from KalSMS:
"<serverURL>,<name1>,<value1>,<...>,<nameN>,<valueN>,<password>"
@@ -192,6 +192,51 @@ Additional parameters sent in POST requests with action=send_status:
+Example request for incoming SMS message:
+
++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 ++ +Example request for incoming MMS message: + +
+TODO ++ +Example request for checking for outgoing SMS messages: + +
+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 ++ +Example request for notifying status of sent message: + +
+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 ++
- <?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>diff --git a/.phrozn/styles/site.css b/.phrozn/styles/site.css index 198b467..4f5188d 100755 --- a/.phrozn/styles/site.css +++ b/.phrozn/styles/site.css @@ -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; } diff --git a/serverapi.html b/serverapi.html index 9ce117e..316db6e 100755 --- a/serverapi.html +++ b/serverapi.html @@ -123,7 +123,7 @@ The following HTTP Headers are sent in all POST requests from KalSMS:
"<serverURL>,<name1>,<value1>,<...>,<nameN>,<valueN>,<password>"
@@ -222,6 +222,51 @@ Additional parameters sent in POST requests with action=send_status:
+Example request for incoming SMS message:
+
++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 ++ +Example request for incoming MMS message: + +
+TODO ++ +Example request for checking for outgoing SMS messages: + +
+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 ++ +Example request for notifying status of sent message: + +
+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 ++
- <?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>diff --git a/styles/site.css b/styles/site.css index 198b467..4f5188d 100755 --- a/styles/site.css +++ b/styles/site.css @@ -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; }