Difference between revisions of "MOR API user details get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
=Description=
[[MOR API]] user details
'''Admin''' – can get any user details<br>
'''Reseller''' – can get his and his users details.<br>
'''User''' – can get his own details.<br>
<br><br>
<br><br>
[[MOR API]] user details
=Usage=
* Call: /api/user_details_get
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
----
===Parametres===
 
* user_id - Users ID in MOR database. '''Required'''. Type: INTEGER
* u - Users username. '''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>
<br><br>
* Call: /api/user_details
===Request===
* Methods: POST, GET(if allowed, not recomended)
 
* Params:
We have user_id = 123, API Secret Key = 456789
** user_id - Users ID in MOR database. '''Required'''. Type: INTEGER
 
** u - Users username. '''Required'''.
We send:
** p - Users password. '''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'''.
HTML POST: /api/user_details_get?u=username&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
* Returns:
 
** Errors:
'''* Note that username and password are not included in hash'''
*** <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>
----
===Returns===
*Example:
 
**We have user_id = 123, API Secret Key = 456789
'''Success'''
**Hash string to be converted: "123456789"
 
**We send:
***/api/user_details?u=admin&p=admin&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
**We get:
  <page>
  <page>
   <pagename>Personal_details</pagename>
   <pagename>Personal_details</pagename>
   <language>en</language>
   <language>en</language>
   <userid>123</userid>
   <userid> user id </userid>
   <details>
   <details>
     <main_detail>
     <main_detail>
       <account>Postpaid</account>
       <account>Postpaid/Prepaid</account>
       <balance>0.0000 USD</balance>
       <balance> balance and currency </balance>
       <balance_number>0.0000</balance_number>  
       <balance_number> balance </balance_number>  
       <balance_currency>USD</balance_currency>
       <balance_currency> currency </balance_currency>
       <credit>Unlimited</credit>
       <credit> credit </credit>
     </main_detail>
     </main_detail>
     <other_details>
     <other_details>
       <username>admin</username>
       <username> username </username>
       <first_name>System</first_name>
       <first_name> first name </first_name>
       <surname>Admin</surname>
       <surname> last name </surname>
       <personalid></personalid>
       <personalid></personalid>
       <agreement_number></agreement_number>
       <agreement_number> </agreement_number>
       <agreement_date>2007-03-26</agreement_date>
       <agreement_date> </agreement_date>
       <taxation_country>Afghanistan</taxation_country>
       <taxation_country> </taxation_country>
       <vat_reg_number></vat_reg_number>
       <vat_reg_number> </vat_reg_number>
       <vat_percent>18.0</vat_percent>
       <vat_percent> </vat_percent>
     </other_details>
     </other_details>
     <registration>
     <registration>
Line 60: Line 68:
   </details>
   </details>
  </page>
  </page>
<br><br>
----


'''* Note that username and password are not included in hash'''
'''Errors'''
 
* <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>
=See also=
 
* [[MOR API]]

Revision as of 11:56, 23 May 2013

Description

MOR API user details

Admin – can get any user details
Reseller – can get his and his users details.
User – can get his own details.


Usage

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



Parametres



Request

We have user_id = 123, API Secret Key = 456789

We send:

HTML POST: /api/user_details_get?u=username&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

* Note that username and password are not included in hash

Returns

Success

<page>
 <pagename>Personal_details</pagename>
 <language>en</language>
 <userid> user id </userid>
 <details>
   <main_detail>
     <account>Postpaid/Prepaid</account>
     <balance> balance and currency </balance>
     <balance_number> balance </balance_number> 
     <balance_currency> currency </balance_currency>
     <credit> credit </credit>
   </main_detail>
   <other_details>
     <username> username </username>
     <first_name> first name </first_name>
     <surname> last name </surname>
     <personalid></personalid>
     <agreement_number> </agreement_number>
     <agreement_date> </agreement_date>
     <taxation_country> </taxation_country>
     <vat_reg_number> </vat_reg_number>
     <vat_percent> </vat_percent>
   </other_details>
   <registration>
     <reg_address></reg_address>
     <reg_postcode></reg_postcode>
     <reg_city></reg_city>
     <reg_country></reg_country>
     <reg_state></reg_state>
     <reg_direction></reg_direction>
     <reg_phone></reg_phone>
     <reg_mobile></reg_mobile>
     <reg_fax></reg_fax>
     <reg_email></reg_email>
   </registration>
 </details>
</page>




Errors

  • <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.\



See also