Difference between revisions of "MOR API device update"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 14: | Line 14: | ||
* '''device''' - device_id. '''Required'''. | * '''device''' - device_id. '''Required'''. | ||
'''Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | '''Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | ||
<br><br> | <br><br> | ||
Parameters which are '''not included''' into hash: | Parameters which are '''not included''' into hash: | ||
* '''[[MOR API hash construction | hash]]''' - SHA1 hash constructed using '''parameters''' which are listed above. Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br> | * '''[[MOR API hash construction | hash]]''' - SHA1 hash constructed using '''parameters''' which are listed above. Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br> | ||
* '''u''' - username for authentication. '''Required'''. | * '''u''' - username for authentication. '''Required'''. | ||
* '''location_id''' - location_id. | |||
<br><br> | <br><br> | ||
===Request=== | ===Request=== | ||
Revision as of 17:58, 14 July 2014
Description
MOR API update existing Device from params.
Usage
- Call: /api/device_update
- Methods: POST, GET(if allowed, not recomended)
Parameters
Parameters which are included into hash:
- device - device_id. Required.
Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key
Parameters which are not included into hash:
- hash - SHA1 hash constructed using parameters which are listed above. Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key ( More described in Constructing hash). Required.
- u - username for authentication. Required.
- location_id - location_id.
Request
HTML POST: http://<SERVER_IP>/billing/api/device_update?u=admin&device=2&location_id=7&hash=297dab8c386794b2e947d52affb8f576c643569e
Returns
Success
<page> <status> <success>Device successfully updated</success> </status> </page>
Errors
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- <error>Access Denied</error> - access not allowed
- <error>Device was not found</error> - Device id incorrect or does not exist
- <error>Location was not found</error> - Location id incorrect or does not exist