Difference between revisions of "MOR API Quickforwards update"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 38: Line 38:
''(example)''
''(example)''


<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<page>
<page>
   <new_quickforward_did>
   <new_quickforward_did>
     <did>37060503666</did>
     <did>37060503666</did>
Line 45: Line 45:
     <description>abyss</description>
     <description>abyss</description>
   </new_quickforward_did>
   </new_quickforward_did>
</page>
</page>
   
   



Revision as of 14:23, 5 August 2013

Description

MOR API Quickforward DID edit.

User - can edit his Quickforward DID which he is able to use.

Usage

  • From MOR X4 call: api/quickforwards_did_update
  • Methods: POST, GET(if allowed, not recomended)



Parameters

  • u - username for authentication. Required.
  • did - DID number which will be edited. Required.
  • forward_to - did, admin assigned you, will be forwarded to forward_to number.
  • description - new description.
  • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).



Request

HTML POST: http://<SERVER_IP>/billing/api/quickforwards_dids_get?username=USERNAME&did=DID&forward_to=NUMBER&description=DESCRIPTION&hash=HASH

Example:

We have username = admin, did=37060503666, forward_to=37066603777, description=abyss and API Secret Key = supervagis

You send:

http://127.0.0.1/billing/api/quickforwards_dids_get?u=admin&did=37060503666&forward_to=37066603777&description=abyss&hash=ac0edcc1934d8faae6c89c00fed967d0e4a6860f

NOTE that username and password are not included in hash

Returns

Success:

(example)

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <new_quickforward_did>
   <did>37060503666</did>
   <forward_to>37066603777</forward_to>
   <description>abyss</description>
 </new_quickforward_did>
</page>

Errors:

  • <error>DID was not found</error> – Specified DID was not found.
  • <error>You are not authorized to use Quickforwards</error> – Such username does not exist in the database or it was not specified.
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>User was not found</error> – User was not found using user_id. Use correct user_id.

See also