Difference between revisions of "MOR API phonebooks get"
From Kolmisoft Wiki
Jump to navigationJump to search
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=Description= | |||
<!---This functionality is available from MOR 11---> | |||
[[MOR API]] Phonebooks list | |||
<br><br> | |||
=Usage= | |||
* From '''MOR X4''' call: '''/api/phonebooks_get''' | |||
* For Backwards-compatibility old name 'phonebooks' is also usable. Call: '''/api/phonebooks''' | |||
* Methods: POST, GET(if allowed, not recomended) | |||
<br><br> | |||
===Parametres=== | |||
[[MOR API]] | * user_id - User ID in MOR database, whose phonebooks we want to see. '''Required'''. | ||
* u - username for authentication. '''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'''. | |||
<br><br> | |||
===Request=== | |||
We have user_id = 123, API Secret Key = 456789 | |||
We send: | |||
HTML POST: http://<SERVER_IP>/billing/api/phonebooks?u=username&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441 | |||
'''NOTE that username and password are not included in hash''' | |||
<br><br> | |||
===Returns=== | |||
'''Success''' | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<page> | |||
<phonebooks> | |||
<phonebook> | |||
<id>1</id> | |||
<name>record name</name> | |||
<number>number</number> | |||
<speeddial>speeddial number</speeddial> | |||
</phonebook> | |||
<phonebook> | |||
<id>2</id> | |||
<name>second record name</name> | |||
<number>second number</number> | |||
<speeddial>second speeddial number</speeddial> | |||
</phonebook> | |||
</phonebooks> | |||
</page> | |||
<br><br> | <br><br> | ||
---- | ---- | ||
'''Errors''' | |||
* <error>No Phonebooks</error> - User does not have phonebooks. | |||
* <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. | |||
<br><br> | <br><br> | ||
=See also= | |||
* | * [[MOR API]] | ||
Latest revision as of 10:55, 26 January 2015
Description
MOR API Phonebooks list
Usage
- From MOR X4 call: /api/phonebooks_get
- For Backwards-compatibility old name 'phonebooks' is also usable. Call: /api/phonebooks
- Methods: POST, GET(if allowed, not recomended)
Parametres
- user_id - User ID in MOR database, whose phonebooks we want to see. Required.
- u - username for authentication. Required.
- hash - SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.
Request
We have user_id = 123, API Secret Key = 456789
We send:
HTML POST: http://<SERVER_IP>/billing/api/phonebooks?u=username&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
NOTE that username and password are not included in hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <phonebooks> <phonebook> <id>1</id> <name>record name</name> <number>number</number> <speeddial>speeddial number</speeddial> </phonebook> <phonebook> <id>2</id> <name>second record name</name> <number>second number</number> <speeddial>second speeddial number</speeddial> </phonebook> </phonebooks> </page>
Errors
- <error>No Phonebooks</error> - User does not have phonebooks.
- <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.