Difference between revisions of "MOR API"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 47: Line 47:


[[API specification to be implemented in the future]]
[[API specification to be implemented in the future]]
=XML API=
API by pages
All pages are requested by POST or GET methods.
== Login page ==
a. Show Login Form <br />
Method: GET (link: /callc/login) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Login page</pagename>
      <language>en</language>
      <error_msg></error_msg>
      <aval_languages>
        <language>en</language>
        <language>ru</language>
      </aval_languages>
    </page>
</code>
b. Login <br />
Method: POST (link: /api/login?u=username&p=password) <br />
Params: 2 <br />
Returns: <br />
If already OK
<code>
    <?xml version="1.0" encoding="utf-8">
    <action>
      <name>login</name>
      <status>ok</status>
      <status_message>Succesfully logged in</status_message>
    </action>
</code>
If something wrong <br />
<code>
    <?xml version="1.0" encoding="utf-8">
    <action>
      <name>login</name>
      <status>failed</status>
      <status_message>Error description</status_message>
    </action>
</code>
== Main Page ==
a. Show welcome page <br />
Method: GET (link: /callc/main) <br />
Params: 0 <br />
Returns:
<code>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <pagename>Main page</pagename>
    <username>Very Important User</username>
    <userid>1</userid>
    <language>en</language>
    <stats>
      <missed_calls>
      <missed_today>2</missed_today>
      <missed_total>8</missed_total>
      </missed_calls>
      <call_history>
        <calls>
          <call_counts>5</call_counts>
          <period>Month</period>
          <call_duration>00:20:35</call_duration>
        </calls>
        <calls>
          <call_counts>1</call_counts>
          <period>Day</period>
          <call_duration>00:01:35</call_duration>
        </calls>
      </call_history>
      <finances>
        <account>Postpaid</account>
        <balance>100 USD</balance>
        <credit>No Limit</credit>   
      </finances>   
    </stats>
  </page>
</code>
== Details ==
----
* Methods: POST, GET(if allowed, not recomended)
* Params:
** user_id - Users ID in MOR database. Required.
** hash - SHA1 hash constructed using user_id and API_Secret_Key (More described in Constructing hash). Required.
* Returns:
** Errors:
*** <error>User was not found</error> - User was not found using user_id. Use correct user_id.
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
----
a. Show personal details <* pasdasbr />
Method: GET (link: /users/personal_details) <br />
Params: 0 <br />
Returns:
<code>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <pagename>Personal details</pagename>
    <language>en</language>
    <userid>1</userid>
    <details>
      <main_details>
          <alias>101</alias>
          <account>Postpaid</account>
          <balance>100 USD</balance>
          <credit>No Limit</credit>
      </main_details>
      <other_details>
          <username>Andrey</username>
          <surname>Mazunin</surname>
          <personalid></personalid>
          <agreement_number></agreement_number>
          <agreement_date>2008-03-11</agreement_date>
          <taxation_country>Uzbekistan</taxation_country>
          <vat_reg_number></vat_reg_number>
          <vat_percent>18.0</vat_percent>
      </other_details>
      <registration>
          <reg_address>Address</reg_address>
          <reg_postcode>700100</reg_postcode>
          <reg_city>Tashkent</reg_city>
          <reg_country>Uzbekistan</reg_country>
          <reg_state></reg_state>
          <reg_direction>Uzbekistan</reg_direction>
          <reg_phone>998975551234</reg_phone>
          <reg_mobile>998975551234</reg_mobile>
          <reg_fax>998975551234</reg_fax>
          <reg_email>admin@voip.com</reg_email>
      </registration> 
  </details>
  </page>
</code>
b. Edit personal details
Desc: User edit personal details and push "Change" button <br />
Method: POST (link: /users/update_personal_details/%userid%) <br />
Params: 17 <br />
Params List:
[[Image:Personal details.png|600px]]<br /><br />
Returns:<br />
If already OK
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>edit_personal</name>
      <status>ok</status>
      <status_message>Personal details changed</status_message>
    </action>
</code>
If something wrong
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>edit_personal</name>
      <status>failed</status>
      <status_message>Error description</status_message>
    </action>
</code>
== Devices ==
a. Show user devices<br />
Method: GET (link: /devices/user_devices) <br />
Params: 0 <br />
Returns:
<code>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <pagename>Devices</pagename>
    <language>en</language>
    <userid>1</userid>
    <devices>
      <device>
          <acc>1</acc>   
          <description>Test device 1</description>
          <type>IAX2</type>
          <extension>101</extension>
          <username>101</username>
          <password>101</password>
          <cid>& quot;101& quot; & lt;101& gt; </cid>
          <last_time_registered>2007-04-06 13:51:07</last_time_registered>
      </device>
      <device>
          <acc>2</acc>   
          <description>Test FAX device</description>
          <type>FAX</type>
          <extension>102</extension>
          <username>102</username>
          <password>102</password>
          <cid>& quot;102& quot; & lt;102& gt; </cid>
          <last_time_registered>2007-04-06 13:51:07</last_time_registered>
      </device>
    </devices>
  </page>
</code>
=== Call Flow ===
a. Show callflow for selected device<br />
Method: GET (link: /devices/callflow/%device_id%) <br />
Params: 1 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Call Flow</pagename>
      <language>en</language>
      <userid>1</userid>
      <device>
        <device_id>1</device_id>
        <device_description>IAX2/101</device_description>
        <device_icon>phone.png</device_icon>
        <callflows>
            <callflow>
                <call_state>Before call</call_state>
                <callflow_action>-</callflow_action>
            </callflow>
            <callflow>
                <call_state>Call</call_state>
                <callflow_action>Dial(IAX2/101)</callflow_action>
            </callflow>
            <callflow>
                <call_state>Answered</call_state>
                <callflow_action>Hangup</callflow_action>
            </callflow>
            <callflow>
                <call_state>No answer</call_state>
                <callflow_action>-</callflow_action>
            </callflow>
            <callflow>
                <call_state>Busy</call_state>
                <callflow_action>Voicemail</callflow_action>
            </callflow>
            <callflow>
                <call_state>Failed</call_state>
                <callflow_action>-</callflow_action>
            </callflow>
          </callflows>
      </device>
    </page>
</code>
b. Edit callflow<br />
Method: GET (link: /devices/callflow_edit/%device_id%?cft=%cf_type%) <br />
Params: 2 <br />
CallFlow Types: <br />
before_call <br />
call<br />
hangup<br />
noanswer<br />
busy<br />
failed<br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Call State</pagename>
      <language>en</language>
      <userid>1</userid>
      <callflow>
        <device_id>1</device_id>
        <device_description>IAX2/101</device_description>
        <device_icon>phone.png</device_icon>
        <call_state>Before call</call_state>
        <actions>
           
++++++++++++++++++++++++++++++++++++++++++++++ <br />
+  Forward action <br />
++++++++++++++++++++++++++++++++++++++++++++++ <br />
              <action>
                <priority>1</priority>
                <action_id>2</action_id>
                    <aval_devices>
                    <device>
                      <device_id>1</device_id>
                      <device_name>SIP/103</device_name>
                      </device>
                      .....
                    </aval_devices> 
                  </action>
++++++++++++++++++++++++++++++++++++++++++++++ <br />
+  Voicemail <br />
++++++++++++++++++++++++++++++++++++++++++++++ <br />
                <action>
                  <priority>1</priority>
                  <action_id>3</action_id>
                  </action>
++++++++++++++++++++++++++++++++++++++++++++++ <br />
+  Faxdetect <br />
++++++++++++++++++++++++++++++++++++++++++++++ <br />
                <action>
                <priority>1</priority>
                <action_id>4</action_id>
                    <aval_devices>
                    <device>
                      <device_id>1</device_id>
                      <device_name>Fax/102</device_name>
                      </device>
                      .....
                    </aval_devices> 
                  </action>
++++++++++++++++++++++++++++++++++++++++++++++ <br />         
        </actions> 
      </callflow>
    </page>
</code>
b. Update callflow type<br />
Method: POST (link: /devices/callflow_edit/%device_id%?cft=%cf_type%) <br />
Params: <br />
whattodo = change_action (hidden) (if set empty action)<br />
Action: forward<br />
Params:<br />
cf_action=forward<br />
whattodo= change_local_device<br />
deviceid=%device_id%<br />
or if forwarding to external number<br />
cf_action=forward<br />
whattodo= change_external_device<br />
ext_number = %ext_number% (number to forwarding)<br />
Action: voicemail<br />
cf_action=voicemail<br />
Action: faxdetect<br />
Params:<br />
cf_action=forward<br />
whattodo= change_fax_device<br />
deviceid=%device_id% <br />
== Rates ==
a. Show all rates<br />
Method: GET (link: /tariffs/user_rates) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Payments</pagename>
      <language>en</language>
      <userid>1</userid>
      <currency>USD</currency>
      <vat_percent>15</vat_percent>
      <aval_currencies>
        <currency>USD</currency>
        <currency>EUR</currency>
      </aval_currencies>
      <rates>
            <rate>
                <ratename>Afghanistan</ratename>
                <rateicon>afg.png</rateicon>
                <ratetype>FIX</ratetype>
                <ratecost>0.02</ratecost>
                <rate_vat_cost>0.03</rate_vat_cost>
            </rate>
            <rate>
                <ratename>Afghanistan</ratename>
                <rateicon>afg.png</rateicon>
                <ratetype>MOB</ratetype>
                <ratecost>0.04</ratecost>
                <rate_vat_cost>0.05</rate_vat_cost>
            </rate>
            .......
        </rates>
    </page>
</code>
b.Destinations <br />
Method: GET (link: /directions/dg_list_user_destinations/%dest_id%) <br />
Params: 1 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Destinations</pagename>
      <language>en</language>
      <groupname>Australia</groupname>
      <groupicon>aust.png</groupicon>
            <directions>
                <direction>
                <details>Australia Canberra</details>
                <prefix>61261</prefix>
                <dir_code>FIX</dir_code>
                </direction>
                <direction>
                <details>Australia Canberra</details>
                <prefix>61262</prefix>
                <dir_code>FIX</dir_code>
                </direction>
            </directions>
    </page>
</code>
=== External links ===
a. Export personal rates <br/>
Method: GET<br/>
Params: 1<br/>
Export to PDF: /tariffs/generate_personal_rates_pdf/%userid%<br/>
Export to CSV: /tariffs/generate_personal_rates_csv/%userid%<br/>
b. Change currency<br/>
Method: GET (link: /tariffs/user_rates?currency=%cur_code%)<br/>
Params: 1<br/>
== Payments ==
a. Show Payments
Method: GET (link: /payments/personal_payments) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Payments</pagename>
      <language>en</language>
      <userid>1</userid>
      <payments>
        <payment>
        <payment_date>2008-03-10 05:41:31</payment_date>
        <confirmed_date>2008-03-10 08:42:00</confirmed_date>
        <payment_type>Manual</payment_type>
        <amount>10</amount>
        <vat>15.0</vat>
        <amount_vat>11.5</amount_vat>
        <currency>USD</currency>
        <completed>Yes</completed>
        </payment>
        <payment>
        <payment_date>2008-03-10 05:41:31</payment_date>
        <confirmed_date>2008-03-10 08:42:00</confirmed_date>
        <payment_type>Manual</payment_type>
        <amount>20</amount>
        <vat>15.0</vat>
        <amount_vat>22.5</amount_vat>
        <currency>EUR</currency>
        <completed>Yes</completed>
        </payment>
      </payments>
    </page>
</code>
== Invoices ==
a. Show Invoices
Method: GET (link: /accounting/user_invoices) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Invoices</pagename>
      <language>en</language>
      <userid>1</userid>
      <invoices>
        <invoice>
            <user>user</user>
            <inv_number></inv_number>
            <period_start>2008-03-10 05:41:31</period_start>
            <period_end>2008-03-10 08:42:00</period_end>
            <issue_date>2008-03-10 08:42:00</issue_date>
            <paid></paid>
            <paid_date>2008-03-10 08:42:00</paid_date>
            <price>10</price>
            <vat>15.0</vat>
            <price_vat>11.5</price_vat>
        </invoice>
      .....
      </invoices>
    </page>
</code>
== Subscriptions ==
a. Show Subscriptions <br/>
Method: GET (link: /services/user_subscriptions) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>User subscriptions</pagename>
      <language>en</language>
      <userid>1</userid>
      <subscriptions>
        <subscription>
        <service>Some useful service</service>
        <date_added>2008-03-10 08:42:00</date_added>
        <acivation_start>2008-03-10 08:42:00</acivation_start>
        <acivation_end>2008-03-10 08:42:00</acivation_end>
        <price>10 USD</price>
        </subscription>
        <subscription>
        <service>Some useful service</service>
        <date_added>2008-03-10 08:42:00</date_added>
        <acivation_start>2008-03-10 08:42:00</acivation_start>
        <acivation_end>2008-03-10 08:42:00</acivation_end>
        <price>10 USD</price>
        </subscription>
        ......
      </subscriptions>
    </page>
</code>
----
<b>need correction</b><br />
a. Show Calls <br />
Method: GET (link: /stats/call_list) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Calls</pagename>
      <language>en</language>
      <error_msg></error_msg>
      <userid>1</userid>
      <show_device>all</show_device>
      <status>all</status>
      <direction>all</direction>
      <total_calls>144</total_calls>     
      <username>Very important user</username>
      <currency>USD</currency>
      <aval_languages>
        <language>en</language>
        <language>ru</language>
      </aval_languages>
      <calls_stat>
        <period>
            <period_start>2008-03-10 05:41:31</period_start>
            <period_end>2008-03-10 08:42:00</period_end>
        </period>
        <calls>
          <call>
            <date>2008-03-10 05:45:31</date>
            <called_from>12129989282</called_from>
            <called_to>12129989282</called_to>
            <destination>United States FIX USA 212 New York</destination>
            <duration>00:00:36</duration>
            <hangup_cause>Answered</hangup_cause>
            <price>0.049</price>
          </call>
        ...........
        </calls>
      </calls_stat>
    </page>
</code>
b. Change period<br />
Method: POST (link: /stats/call_list) <br />
Params: 7 <br />
%userid% - Current UserId <br />
%search_on% (always 1?)<br />
%period_start%<br />
%period_end%<br />
%direction%<br />
%calltype% (outgoing - incoming - all)<br />
%device% (show_device = all or device_id)<br />
Returns: See a. <br />
=== External links ===
a. Export calls <br/>
Method: GET<br/>
Params: 4<br/>
Export to PDF: /stats/call_list_to_pdf/%userid%?call_type=%calltype%&date_from=%period_start%&date_till=%period_end%<br/>
Export to CSV: /stats/call_list_to_csv/%userid%?call_type=%calltype%&date_from=%period_start%&date_till=%period_end%<br/>
== New calls ==
a. Show new Calls <br />
Method: GET (link: /stats/new_calls_list) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Calls</pagename>
      <language>en</language>
      <error_msg></error_msg>
      <userid>1</userid>
      <calls_stat>
        <total_calls>2</total_calls>
        <calls>
          <call>
            <date>2008-03-10 05:45:31</date>
            <called_from>12129989282</called_from>
            <called_to>12129989282</called_to>
            <duration>00:00:36</duration>
            <hangup_cause>Answered</hangup_cause>
          </call>
        ...........
        </calls>
      </calls_stat>
    </page>
== Missed calls ==
a. Show missed Calls <br />
Method: GET (link: /stats/missed_calls) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Missed calls</pagename>
      <language>en</language>
      <error_msg></error_msg>
      <userid>1</userid>
      <missed_total>9</missed_total>     
      <username>Very important user</username>
      <aval_languages>
        <language>en</language>
        <language>ru</language>
      </aval_languages>
      <calls_stat>
        <period>
            <period_start>2008-03-10 05:41:31</period_start>
            <period_end>2008-03-10 08:42:00</period_end>
        </period>
        <calls>
          <call>
            <call_id>855</call_id>
            <date>2008-03-10 05:45:31</date>
            <called_from>12129989282</called_from>
            <called_to>12129989282</called_to>
            <duration>00:00:36</duration>
            <hangup_cause>No Answer</hangup_cause>
            <<processed>0</processed>
          </call>
        ...........
        </calls>
      </calls_stat>
    </page>
</code>
b. Change period<br />
Method: POST (link: /stats/missed_calls) <br />
Params: 7 <br />
%userid% - Current UserId <br />
%search_on% (always 1?)<br />
%period_start%<br />
%period_end%<br />
Returns: See a. <br />
c. Process call<br />
Method: POST (link: /stats/missed_calls) <br />
Params: 1 <br />
%processed% <br />
Returns: See a. <br />
== Graphs (Detailed Statistics) ==
a. Show detailed statistics page <br />
Method: GET (link: /stats/user_stats) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Detailed statistics</pagename>
      <language>en</language>
      <userid>1</userid>
      <start_date>2008-03-10</start_date>
      <end_date>2008-03-11</end_date>
      <details>
        <main_details>
            <todays_normative>0</todays_normative>
            <months_normative>0</months_normative>
            <new_calls>0</new_calls>
        </main_details>
        <calls>
            <incoming>
                <answered>0</answered>
                <no_answer>1</no_answer>
                <busy>0</busy>
                <failed>0</failed>
            </incoming>
            <outgoing>
                <answered>0</answered>
                <no_answer>1</no_answer>
                <busy>0</busy>
                <failed>0</failed>
            </outgoing>
        </calls>
        <detailed_by_date>
            <call_by_date>
                <date>2008-03-11</date>
                <calls_count>1</calls_count>
                <duration>1.5</duration>
                <avg_time>1.5</avg_time>
                <calls_normative>100</calls_normative>
            </call_by_date>
            <call_by_date>
                <date>2008-03-10</date>
                <calls_count>1</calls_count>
                <duration>1.5</duration>
                <avg_time>1.5</avg_time>
                <calls_normative>100</calls_normative>
            </call_by_date>
        </detailed_by_date>
        </details>
    </page>
</code>
b. Change dates <br />
Method: POST (link: /billing/stats/user_stats) <br />
Params: 2 <br />
%period_start% <br />
%period_end% <br />
Returns: See a.
== CLIs ==
a. Show all CallerIDs<br />
Method: GET (link: /devices/user_device_clis) <br />
Params: 0 <br />
Returns: 
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>CallerIDs</pagename>
      <language>en</language>
      <userid>1</userid>
      <aval_devices>
        <device id="1">IAX2/101</device>
        <device id="2">FAX/102</device>
      </aval_devices>
      <clis>
        <cli>
            <cli_id>3</cli_id>
            <device>IAX2/101</device>
            <device_icon>phone.png</device_icon>
            <cli_name>5555555</cli_name>
            <cli_desc>Linus</cli_desc>
            <added_at>2007-04-06 13:51:07</added_at>
        </cli>
      .....
      </clis>
    </page>
</code>
b. Add new cli
Method: POST(link: /devices/cli_add) <br />
Params: 3 <br />
%device_id% <br />
%cli% <br />
%description% <br />
Returns: 
If already OK
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>add_cli</name>
      <status>ok</status>
      <status_message>CLI created</status_message>
    </action>
</code>
If something wrong
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>add_cli</name>
      <status>failed</status>
      <status_message>CLI not created</status_message>
    </action>
</code>
== Phonebook ==
a. Show phonebook<br />
Method: GET (link: /phonebooks/list/%userid%) <br />
Params: 1<br />
Returns:
<code>
<?xml version="1.0" encoding="UTF-8"?>
<page>
  <pagename>Phonebook</pagename>
  <language>en</language>
  <userid>1</userid>
  <entries>
      <entry>
        <entry_number>12015551234</entry_number>
        <entry_name>ExGirlfriend</entry_name>
        <entry_added>2008-03-01 15:44:05</entry_added>
      </entry>
  ...........
  </entries>
</page>
</code>
b. Add new entry <br />
Method: POST (/phonebooks/add_new/%userid%) <br />
Params: 3 <br />
%userid% <br />
%number% <br />
%name% <br />
Returns:<br />
If already OK
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>add_phonebook_entry</name>
      <status>ok</status>
      <status_message>Record added</status_message>
    </action>
</code>
If something wrong
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>add_phonebook_entry</name>
      <status>failed</status>
      <status_message>Please fill all fields</status_message>
    </action>
</code>
b. Delete entry <br />
Method: POST (/phonebooks/destroy/%entryid%) <br />
Params: 1 <br />
%entryid%<br />
Returns:<br />
If already OK
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>delete_phonebook_entry</name>
      <status>ok</status>
      <status_message>Record deleted</status_message>
    </action>
</code>
If something wrong
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <action>
      <name>delete_phonebook_entry</name>
      <status>failed</status>
      <status_message>We're sorry, but something went wrong</status_message>
    </action>
</code>
== Faxes ==
<b>need correction</b><br />
a. Show Faxes page <br />
Method: GET (link: /stats/faxes_list/%userid%) <br />
Params: 0 <br />
Returns:
<code>
    <?xml version="1.0" encoding="UTF-8"?>
    <page>
      <pagename>Faxes</pagename>
      <language>en</language>
      <error_msg></error_msg>
      <userid>1</userid>
      <show_device>all</show_device>
      <username>Very important user</username>
      <aval_languages>
        <language>en</language>
        <language>ru</language>
      </aval_languages>
      <faxes>
        <period>
            <period_start>2008-03-10 05:41:31</period_start>
            <period_end>2008-03-10 08:42:00</period_end>
        </period>
        <fax>
            <device>FAX/102</device>
            <filename></filename>
            <receive_time>2008-03-10 05:45:31</receive_time>
            <sender></sender>
            <status>Received</status>
        </fax>
        ...........
    </faxes>
    </page>
</code>
b. Change period<br />
Method: POST (link: /stats/faxes_list/%userid%) <br />
Params: 6 <br />
%userid% - Current UserId <br />
%search_on% <br />
%period_start%<br />
%period_end%<br />
%fax_status%<br />
%device_id%<br />
Returns: See a. <br />
== Callback ==
a. Execute Callback <br />
Method: POST (link: /functions/activate_callback?src=%source%&dst=%destination%&acc=%device%) <br />
Params: 3 <br />
Returns: <br />
If already OK
<code>
    <?xml version="1.0" encoding="utf-8">
    <action>
      <name>callback</name>
      <status>ok</status>
      <status_message>Callback activated</status_message>
    </action>
</code>
If something wrong <br />
<code>
    <?xml version="1.0" encoding="utf-8">
    <action>
      <name>callback</name>
      <status>failed</status>
      <status_message>Error description</status_message>
    </action>
</code>

Revision as of 15:38, 29 December 2008

MOR API lets other software interact to MOR without knowing internal structure of DB and other logic.

MOR accepts requests by HTML POST and returns result in XML.


Functions

Login

  • login - Logs in user into MOR
  • logout - Logs out user from MOR

Callback

Accounting

  • invoices - Retrieves list of invoices in selected time period.

Calls

  • calls - Retrieves list of calls in selected time period for some user/device

API Related





HTML POST

All requests are in similar format:

HTML POST: http://<SERVER_IP>/mor/api/<function>?u=username&p=password
  • username/password - of the user who is asking for the data.

If user has 'admin' rights - he will get more results and he can perform more actions compared to the user who does not have such rights.




Following functionality WILL BE implemented IN THE FUTURE




API specification to be implemented in the future