MOR API device delete

From Kolmisoft Wiki
Revision as of 08:08, 7 December 2012 by Aisteb (talk | contribs)
Jump to navigationJump to search

MOR API Delete device






  • Call: /api/device_destroy
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • device - Device ID in MOR database, whose datas we want to delete. Required.
    • u - username to login. Required.
    • p - password to login. Required.
    • hash - SHA1 hash constructed using device and API_Secret_Key ( More described in Constructing hash). Required.
  • Returns:
    • Success
      • <status>Device was deleted</status>


    • Errors:
      • <error>Device was not found</error> - Device was not found using device. Use correct device id.
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
      • <error>Registration over API is disabled</error> - Setting: Settings->API->API allow Registration, is off. Turn on API allow Registration.
      • <error>Dont be so smart</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.




  • Example:
    • We have device = 123, API Secret Key = 456789
    • Hash string to be converted: "123456789"
    • We send:
      • /api/device_destroy?u=admin&p=admin&device=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

* Note that username and password are not included in hash