Difference between revisions of "MOR API devices get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 8: Line 8:
** u – username to login. '''Required'''.
** u – username to login. '''Required'''.
** p – password to login. '''Required'''.
** p – password to login. '''Required'''.
** user_id – this specifies user id whose custom rates and tariffs to show. When sending user_id parameter tariff_id parameter is ignored.  
** user_id – this specifies user id whose device list to show.  
** [[MOR API hash construction | hash]] – SHA1 hash constructed using '''user_id''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
** [[MOR API hash construction | hash]] – SHA1 hash constructed using '''user_id''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.


Line 42: Line 42:
<br><br>
<br><br>
----
----
*Example:
*Example:
**We have API Secret Key = 456789, user_id = 100
**We have API Secret Key = 456789, user_id = 100

Revision as of 12:28, 29 March 2013

MOR API Device list


  • Call: /api/device_list
  • Params:
    • u – username to login. Required.
    • p – password to login. Required.
    • user_id – this specifies user id whose device list to show.
    • hash – SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.


Returning XML is put in file. That file is gziped and returned as a response content.

Please note that admin/reseller can retrieve Device list just for their own Users.


  • Errors:
    • <error>User not found</error> – User was not found.
    • <error>Bad login</error> – User was not found by username and password. Use correct username and password. Make sure that username (u) and password (p) are specified.
    • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • Returns:
<page>
  <devices>
    <device>
       <device_id>2</device_id>
       <device_type>IAX2</device_type>
     </device>
    <device>
       <device_id>3</device_id>
       <device_type>FAX</device_type>
     </device>
    <device>
       <device_id>4</device_id>
       <device_type>IAX2</device_type>
     </device>
   </devices>
 </page>




  • Example:
    • We have API Secret Key = 456789, user_id = 100
    • Hash string to be converted: "100456789"
    • We send:
      • /api/device_list?u=admin&p=admin&user_id=100&hash=71516eea4850f7e0300ac86adf9fb64bca845aa7

* Note that username and password are not included in hash