Difference between revisions of "MOR API phonebook edit"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
''This functionality is available from [[MOR 12| MOR 12]]''
=Description=
<!---This functionality is available from MOR 11--->
[[MOR API]] Phonebook edit
<br><br>
=Usage=


* Call: /api/phonebook_edit
* Methods: POST, GET(if allowed, not recomended)
<br><br>
===Parametres===


[[MOR API]]
* phonebook_id - Phonebook ID in MOR database. '''Required'''.
* u - username for authentication. '''Required'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
* number
* name
* speeddial
<br><br>
===Request===


Credit note update
We have phonebook_id = 123, name=phonebook, number=920355666, speeddial=666  and API Secret Key = 456789


We send:
HTML POST: http://<SERVER_IP>/billing/api/phonebook_edit?u=username&phonebook_id=123&name=phonebook&number=920355666&speeddial=666&hash=fe2532c8b6b0a04fa8610bb666614a821f269b85
'''NOTE that username and password are not included in hash'''
<br><br>
<br><br>
----
===Returns===
<br><br>


* Call: /api/credit_note_update
'''Success'''
* Methods: POST, GET(if allowed, not recomended)
* Params:
** credit_note_id - Credit note ID in MOR database. '''Required'''.
** u - username to login. '''Required'''.
** p - password to login. '''Required'''.
** status - status of credit note, posible values are 'paid', 'unpaid'. '''Optional'''
** comment - unlimited length text. '''Optional'''
** [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.


* Returns:
<?xml version="1.0" encoding="UTF-8"?>
**Success
<page>
*** <status>Credit note updated</status>
    <status>Phonebook saved</status>
** Errors:
</page>
*** <error>Credit note was not saved</error>
<br><br>
*** <error>Bad login</error>
----
*** <error>Credit note was not found</error> - credit note was not found using phonebook_id. Use correct phonebook id.
'''Errors'''
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.


* <error>Phonebook was not saved</error>
** <message>problem message</message>
* <error>Phonebook was not found</error> - Phonebook  was not found using phonebook_id. Use correct phonebook id.
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
* <error>Access Denied</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.
<br><br>
<br><br>
----
=See also=
*Example:
 
**We have credit_note_id = 123, API Secret Key = 456789
* [[MOR API]]
**Hash string to be converted: "123456789"
* [[Speed Dials]]
**We send:
* [[PhoneBook]] API: [[MOR_API_phonebooks_get|List]]
***/api/credit_note_update?u=admin&p=admin&credit_note_id=123&status=paid&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
'''* Note that username and password are not included in hash'''

Latest revision as of 09:04, 19 May 2014

Description

MOR API Phonebook edit

Usage

  • Call: /api/phonebook_edit
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • phonebook_id - Phonebook ID in MOR database. Required.
  • u - username for authentication. Required.
  • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
  • number
  • name
  • speeddial



Request

We have phonebook_id = 123, name=phonebook, number=920355666, speeddial=666 and API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/phonebook_edit?u=username&phonebook_id=123&name=phonebook&number=920355666&speeddial=666&hash=fe2532c8b6b0a04fa8610bb666614a821f269b85


NOTE that username and password are not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>Phonebook saved</status>
</page>




Errors

  • <error>Phonebook was not saved</error>
    • <message>problem message</message>
  • <error>Phonebook was not found</error> - Phonebook was not found using phonebook_id. Use correct phonebook id.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>Access Denied</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.



See also