Difference between revisions of "M4 API user details get"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '=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 det…') |
|||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
=Description= | =Description= | ||
[[ | [[M4 API]] user details | ||
'''Admin''' – can get any user details<br> | '''Admin''' – can get any user details<br> | ||
'''User''' – can get his own details.<br> | '''User''' – can get his own details.<br> | ||
<br><br> | <br><br> | ||
=Usage= | =Usage= | ||
* | * '''M4'' call: '''/api/user_details_get''' | ||
* For Backwards-compatibility old name 'user_details' is also usable. Call: '''/api/user_details''' | * For Backwards-compatibility old name 'user_details' is also usable. Call: '''/api/user_details''' | ||
* Methods: POST, GET(if allowed, not recomended) | * Methods: POST, GET(if allowed, not recomended) | ||
| Line 17: | Line 16: | ||
Parameters which are '''included''' into hash: | Parameters which are '''included''' into hash: | ||
* '''user_id''' - Users ID in | * '''user_id''' - Users ID in M4 database. '''Required if username is not used'''. Type: INTEGER | ||
* '''username''' - Users Username in | * '''username''' - Users Username in M4 database. '''Required if user_id is not used'''. | ||
You are able to use these parameter one by one or both at a time. If you use them both at a time '''note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | You are able to use these parameter one by one or both at a time. If you use them both at a time '''note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | ||
<br><br> | <br><br> | ||
Parameters which are '''not included''' into hash: | Parameters which are '''not included''' into hash: | ||
* '''[[ | * '''[[M4 API hash construction | hash]]''' - SHA1 hash constructed using '''parameters''' which are listed above. You are able to use these parameters one by one or both at a time. If you use them both at a time note that parameters are shown in the same order as they have to be when generating the hash. The last parameter in a row is '''API_Secret_Key''' ([[M4 API hash construction | More described in Constructing hash]]). '''Required'''.<br> | ||
* '''u''' - username for authentication. '''Required'''. | * '''u''' - username for authentication. '''Required'''. | ||
| Line 71: | Line 70: | ||
</main_detail> | </main_detail> | ||
<other_details> | <other_details> | ||
<user_status>prepaid</user_status> | |||
<username> username </username> | <username> username </username> | ||
<first_name> first name </first_name> | <first_name> first name </first_name> | ||
| Line 107: | Line 107: | ||
=See also= | =See also= | ||
* [[ | * [[M4 API]] | ||
Latest revision as of 12:24, 9 September 2025
Description
M4 API user details
Admin – can get any user details
User – can get his own details.
Usage
- M4 call: /api/user_details_get'
- For Backwards-compatibility old name 'user_details' is also usable. Call: /api/user_details
- Methods: POST, GET(if allowed, not recomended)
Parametres
Parameters which are included into hash:
- user_id - Users ID in M4 database. Required if username is not used. Type: INTEGER
- username - Users Username in M4 database. Required if user_id is not used.
You are able to use these parameter one by one or both at a time. If you use them both at a time note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key
Parameters which are not included into hash:
- hash - SHA1 hash constructed using parameters which are listed above. You are able to use these parameters one by one or both at a time. If you use them both at a time note that parameters are shown in the same order as they have to be when generating the hash. The last parameter in a row is API_Secret_Key ( More described in Constructing hash). Required.
- u - username for authentication. Required.
Request
We have user_id = 123, API Secret Key = 456789
We send:
HTML POST: http://<server_ip>/billing/api/user_details_get?u=username&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
We have username = username, API Secret Key = 456789
We send:
HTML POST: http://<server_ip>/billing/api/user_details_get?u=username&username=username&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
We have user_id = 123, username = username, API Secret Key = 456789
We send:
HTML POST: http://<server_ip>/billing/api/user_details_get?u=username&user_id=123&username=username&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>
<user_status>prepaid</user_status>
<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>
<call_limit> </call_limit>
</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 and/or username. Use correct user_id and/or username.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.