Difference between revisions of "MOR API Service update"
From Kolmisoft Wiki
Jump to navigationJump to search
m (→Request) |
|||
Line 49: | Line 49: | ||
* <error>You are not authorized to use this functionality</error> - User has no permissions to manage Services. | * <error>You are not authorized to use this functionality</error> - User has no permissions to manage Services. | ||
* <error>Access Denied</error> - User can not Manage Services and can not get permissions to use it. | * <error>Access Denied</error> - User can not Manage Services and can not get permissions to use it. | ||
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or | * <error>Service was not selected</error> - service_id parameter was not passed. | ||
* <error>Service was not found</error> - Service with passed service_id parameter was not found. | |||
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or parameters while concatenating hash_string. | |||
<br><br> | <br><br> | ||
Revision as of 07:34, 24 September 2014
NOTE: Available from MOR X5
Description
MOR API Update Service
Usage
- From MOR X5 Call: /api/service_update
- Methods: POST, GET(if allowed, not recomended)
Parametres
Parameters which are included into hash:
- service_id - Service ID, which we want to delete. Required.
- u - username for authentication. Required.
- hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
Parameters which are not included into hash:
- service_name - name of Service.
- service_type - type of Service (periodic_fee, one_time_fee, flat-rate).
- service_sell_price - sell price of Service.
- service_self_cost - cost of Service.
- service_period - period of Service (month, day, by default month only for Periodic Fee type).
- service_minutes_per_month - how many minutes User is allowed to use Service (only for Flat Rate type).
Request
We have Service ID = 19, API Secret Key = secret
We send:
HTML POST: http://<SERVER_IP>/billing/api/service_update?u=admin&service_id=19&service_name=ddddddd&hash=38282ca5e65e63746498ef5b39a2fe71c6448df4
NOTE that username is not included in hash
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>Service successfully updated</success> </status> </page>
Errors
- <error>Service Type is invalid</error> - Service type is unknown. It should be periodic_fee or one_time_fee or flat-rate.
- <error>Quantity must be numeric</error> - Quantity was not numeric.
- <error>Quantity must be greater than zero</error> - Quantity is less than zero.
- <error>You are not authorized to use this functionality</error> - User has no permissions to manage Services.
- <error>Access Denied</error> - User can not Manage Services and can not get permissions to use it.
- <error>Service was not selected</error> - service_id parameter was not passed.
- <error>Service was not found</error> - Service with passed service_id parameter was not found.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or parameters while concatenating hash_string.