Difference between revisions of "MOR API devices get"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: | Line 1: | ||
=Description= | |||
<!---This functionality is available from MOR X3---> | <!---This functionality is available from MOR X3---> | ||
[[MOR API]] Device list | [[MOR API]] Device list | ||
<br><br> | <br><br> | ||
=Usage= | |||
* Call: /api/ | * Call: /api/devices_get | ||
* For Backwards-compatibility old name 'device_list' is also usable. Call: /api/device_list | |||
* | * Methods: POST, GET(if allowed, not recomended) | ||
* | <br><br> | ||
===Parametres=== | |||
* u – username for authentication. '''Required'''. | |||
* 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'''. | |||
Returning XML is put in file. That file is gziped and returned as a response content. | 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. | Please note that admin/reseller can retrieve Device list just for their own Users. | ||
<br><br> | |||
===Request=== | |||
We have API Secret Key = 456789, user_id = 100 | |||
We send: | |||
HTML POST: http://<SERVER_IP>/billing/api/devices_get?u=admin&user_id=100&hash=71516eea4850f7e0300ac86adf9fb64bca845aa7 | |||
* | |||
'''* Note that username and password are not included in hash''' | |||
<br><br> | |||
===Returns=== | |||
'''Success''' | |||
<page> | <page> | ||
<devices> | <devices> | ||
<device> | <device> | ||
<device_id> | <device_id>device_id</device_id> | ||
<device_type> | <device_type>device_type</device_type> | ||
</device> | </device> | ||
<device> | |||
<device_id>second_device_id</device_id> | |||
<device_type>second_device_type</device_type> | |||
<device_id> | |||
<device_type> | |||
</device> | </device> | ||
</devices> | </devices> | ||
</page> | </page> | ||
<br><br> | |||
---- | |||
'''Errors''' | |||
* <error>User not found</error> – User was not found. | |||
* <error>user_id is empty</error> – user_id was not sent. | |||
* <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. | |||
<br><br> | <br><br> | ||
=See also= | |||
* | * [[MOR API]] | ||
Revision as of 09:19, 25 May 2013
Description
MOR API Device list
Usage
- Call: /api/devices_get
- For Backwards-compatibility old name 'device_list' is also usable. Call: /api/device_list
- Methods: POST, GET(if allowed, not recomended)
Parametres
- u – username for authentication. 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.
Request
We have API Secret Key = 456789, user_id = 100
We send:
HTML POST: http://<SERVER_IP>/billing/api/devices_get?u=admin&user_id=100&hash=71516eea4850f7e0300ac86adf9fb64bca845aa7
* Note that username and password are not included in hash
Returns
Success
<page> <devices> <device> <device_id>device_id</device_id> <device_type>device_type</device_type> </device> <device> <device_id>second_device_id</device_id> <device_type>second_device_type</device_type> </device> </devices> </page>
Errors
- <error>User not found</error> – User was not found.
- <error>user_id is empty</error> – user_id was not sent.
- <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.