Difference between revisions of "MOR API Service update"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '= NOTE: Available from MOR X5 = =Description= MOR API Update Service <br><br> =Usage= * From '''MOR X5''' Call: '''/api/service_update''' * Methods: POST, GET(if allowed, n…') |
|||
Line 17: | Line 17: | ||
<br> | <br> | ||
Parameters which are '''not included''' into hash: | Parameters which are '''not included''' into hash: | ||
* service_name - name of Service | * service_name - name of Service. | ||
* service_type - type of Service (periodic_fee, one_time_fee, flat-rate) | * service_type - type of Service (periodic_fee, one_time_fee, flat-rate). | ||
* service_sell_price - sell price of Service | * service_sell_price - sell price of Service. | ||
* service_self_cost - cost of Service | * service_self_cost - cost of Service. | ||
* service_period - period of Service (month, day, by default month only for Periodic Fee type) | * 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). | * service_minutes_per_month - how many minutes User is allowed to use Service (only for Flat Rate type). | ||
===Request=== | ===Request=== | ||
Revision as of 07:12, 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&test=1
NOTE that username is not included in hash
Success
<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>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.