Difference between revisions of "MOR API sms send"

From Kolmisoft Wiki
Jump to navigationJump to search
m
Line 1: Line 1:
[[MOR API]]
= About =
SMS API is used to integrate MOR with other external systems like CRM, ERP or other for SMS sending through them.


Send SMS
Users which can user SMS API:
* admin
* reseller - starting from MOR 12


<br><br>
 
----
== Send SMS ==
<br><br>


* Call: /api/send_sms
* Call: /api/send_sms
Line 18: Line 20:
'''* Note that message must be in [http://meta.wikimedia.org/wiki/Help:URL URL Encode]'''
'''* Note that message must be in [http://meta.wikimedia.org/wiki/Help:URL URL Encode]'''


* Returns:
===Returns===
**Success
**Success
   <status>ok</status>
   <status>ok</status>
Line 28: Line 30:
   </message>
   </message>


** Errors:
=== Errors ===
*** <error>There is no message or it is empty</error>
*** <error>There is no message or it is empty</error>
*** <error>Wrong source</error>
*** <error>Wrong source</error>
Line 38: Line 40:
*** <error>Bad login</error>  
*** <error>Bad login</error>  
<br><br>
<br><br>
----
 
*Example:
===Example===
**We have lcr_id = 1, dst = 937567337911, src = 9375783123767, message = 1a2b3c4d, API key = 123456
**We have lcr_id = 1, dst = 937567337911, src = 9375783123767, message = 1a2b3c4d, API key = 123456
**We send:
**We send:
***/api/send_sms?u=username&p=password&lcr_id=1&dst=937567337911&src=9375783123767&message=1a2b3c4d&hash=cc0e27123e27f08de2fbc68a2c8ba0b213654687
***/api/send_sms?u=username&p=password&lcr_id=1&dst=937567337911&src=9375783123767&message=1a2b3c4d&hash=cc0e27123e27f08de2fbc68a2c8ba0b213654687
'''* Note that username and password are not included in hash'''
'''* Note that username and password are not included in hash'''
=== See also ===
* [[MOR API]]
<br><br>

Revision as of 09:30, 27 November 2012

About

SMS API is used to integrate MOR with other external systems like CRM, ERP or other for SMS sending through them.

Users which can user SMS API:

  • admin
  • reseller - starting from MOR 12


Send SMS

  • Call: /api/send_sms
  • Params:
    • lcr_id - LCR ID in MOR database. Required.
    • u - username to login. Required.
    • p - password to login. Required.
    • dst - Destination number. Required.
    • src - Source number. Required.
    • message - Message that you want to send. Required.
    • hash - SHA1 hash constructed using API_Secret_Key ( More described in Constructing hash). Required.

* Note that message must be in URL Encode

Returns

    • Success
 <status>ok</status>
 <message>
    <message_id>1</message_id>
    <sms_status_code_tip>0 - sent, SMS is sent</sms_status_code_tip>
    <price>0.5000</price>
    <currency>USD</currency>
 </message>

Errors

      • <error>There is no message or it is empty</error>
      • <error>Wrong source</error>
      • <error>Wrong destination</error>
      • <error>There is no such LCR</error>
      • <error>User is not subscribed to sms service</error>
      • <error>1 - failed, admin does not have rate for this destination</error> - SMS status code and tip SMS Addon - Status codes
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
      • <error>Bad login</error>



Example

    • We have lcr_id = 1, dst = 937567337911, src = 9375783123767, message = 1a2b3c4d, API key = 123456
    • We send:
      • /api/send_sms?u=username&p=password&lcr_id=1&dst=937567337911&src=9375783123767&message=1a2b3c4d&hash=cc0e27123e27f08de2fbc68a2c8ba0b213654687

* Note that username and password are not included in hash


See also