Difference between revisions of "MOR API device create"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 15: Line 15:
** type - Device type [SIP, IAX2, FAX, Virtual,H323, ZAP, Skype, '']. When is '' -> default device type. If default device type is empty -> 'SIP'
** type - Device type [SIP, IAX2, FAX, Virtual,H323, ZAP, Skype, '']. When is '' -> default device type. If default device type is empty -> 'SIP'
** devicegroup_id - device group ID  
** devicegroup_id - device group ID  
**  
** caller_id - CallerID
* Returns:
* Returns:
**Success
**Success
Line 27: Line 27:
*** <error>Pin_is_already_used</error> - Enter onother pin.
*** <error>Pin_is_already_used</error> - Enter onother pin.
*** <error>Pin_must_be_numeric</error> - Enter correct pin.
*** <error>Pin_must_be_numeric</error> - Enter correct pin.
*** <error>You are not authorized to manage callerid</error> - User does not have permissions to manage CallerID option.
*** <error>Device was not created</error>
*** <error>Device was not created</error>
**** <message>problem message</message>
**** <message>problem message</message>

Revision as of 13:52, 17 January 2013

MOR API Create device




  • Call: /api/device_create
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • user_id - User ID in MOR database, for which user device should be created. Required.
    • u - username to login. Required.
    • p - password to login. Required.
    • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
    • description - string
    • pin - [number. ]. If pin param not send -> random_numbers . If blank -> pinless
    • type - Device type [SIP, IAX2, FAX, Virtual,H323, ZAP, Skype, ]. When is -> default device type. If default device type is empty -> 'SIP'
    • devicegroup_id - device group ID
    • caller_id - CallerID
  • Returns:
    • Success
      • <status>Device was created</status>
    • 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.
      • <error>Dont be so smart</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.
      • <error>Device_type_invalid</error> - Enter correct type.
      • <error>Device_group_invalid</error> - Device group with id not found. Enter group id.
      • <error>Pin_is_already_used</error> - Enter onother pin.
      • <error>Pin_must_be_numeric</error> - Enter correct pin.
      • <error>You are not authorized to manage callerid</error> - User does not have permissions to manage CallerID option.
      • <error>Device was not created</error>
        • <message>problem message</message>


Request

http://123.123.123.123/billing/api/device_create/u=admin&p=password&user_id=2&description=desription1&pin=3&hash=6e79d4a82f68102f43be11d873177f47817f84df

  • admin - owner's username
  • password - owner's password
  • user_id - for which user device should be created




     <head></head>
     <body>
           <page>
                 <status>Device created</status>
                 <id>8</id>
           </page>
     </body>
     <head></head>
     <body>
           <page>
                 <status>Device created</status>
                 <id>13</id>
           </page>
     </body>
  • Now we can find these Devices in GUI Devices list.

* Note that username and password are not included in hash