Difference between revisions of "MOR API conflines update"
From Kolmisoft Wiki
Jump to navigationJump to search
(6 intermediate revisions by 3 users not shown) | |||
Line 12: | Line 12: | ||
No parameters are '''included''' into hash. Hash is generated only using admin's API secret key. | No parameters are '''included''' into hash. Hash is generated only using admin's API secret key. | ||
<br><br> | <br><br> | ||
Parameters which are '''not included''' into hash: | Parameters which are '''not included''' into hash: | ||
Line 30: | Line 28: | ||
* '''default_user_recording_enabled''' - send 0 for disabled, 1 - enabled. | * '''default_user_recording_enabled''' - send 0 for disabled, 1 - enabled. | ||
* '''default_user_recording_forced_enabled''' - send 0 for disabled, 1 - enabled. | * '''default_user_recording_forced_enabled''' - send 0 for disabled, 1 - enabled. | ||
* '''default_user_tariff_id''' - ID of existing Tariff. | |||
* '''default_device_call_limit''' - send positive number | * '''default_device_call_limit''' - send positive number | ||
* '''default_device_canreinvite''' - one of these values: ''yes'', ''no'', ''nonat'', ''update'', ''update,nonat''. | * '''default_device_canreinvite''' - one of these values: ''yes'', ''no'', ''nonat'', ''update'', ''update,nonat''. | ||
Line 37: | Line 36: | ||
* '''default_device_audio_codecs''' - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: ''alaw'', ''ulaw'', ''g723'', ''g726'', ''g729'', ''gsm'', ''ilbc'', ''lpc10'', ''speex'', ''sdpcm'', ''slin''. | * '''default_device_audio_codecs''' - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: ''alaw'', ''ulaw'', ''g723'', ''g726'', ''g729'', ''gsm'', ''ilbc'', ''lpc10'', ''speex'', ''sdpcm'', ''slin''. | ||
* '''default_device_video_codecs''' - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: ''h261'', ''h263'', ''h263p'', ''h264''. | * '''default_device_video_codecs''' - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: ''h261'', ''h263'', ''h263p'', ''h264''. | ||
* '''default_device_location_id''' - ID of existing Location. | |||
* '''[[MOR API hash construction | hash]]''' - SHA1 hash constructed using '''parameters''' which are listed above. 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''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br> | * '''[[MOR API hash construction | hash]]''' - SHA1 hash constructed using '''parameters''' which are listed above. 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''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br> | ||
<br> | |||
'''NOTE:''' reseller is not required to enable API. This method uses admin's API settings. | |||
<br><br> | |||
'''Additional feature''' | |||
<br><br> | |||
* If API setting '''Allow Resellers to use Admin Localization Rules''' is enabled, Reseller is able to set location inherited from Admin. '''default_device_location_id''' should be used as a parameter for Location.<br> | |||
* If API setting '''Allow Resellers to use Admin Quick Forward Rules''' is enabled, Reseller is able to set Quick Forward Rules inherited from Admin. '''default_user_quickforwards_rule_id''' should be used as a parameter for Quick Forward Rules.<br> | |||
* If API setting '''Allow Resellers to use Admin Tariffs''' is enabled, Reseller is able to set Tariff inherited from Admin. '''default_user_tariff_id''' should be used as a parameter for Tariff. | |||
<br><br> | <br><br> | ||
===Request=== | ===Request=== | ||
HTML POST: http://<SERVER_IP>/billing/api/conflines_update?u=admin&api_secret_key=987654321&default_device_video_codecs=h263&default_device_audio_codecs=ilbc,speex&default_device_grace_time=111&default_device_qualify=2356&default_device_nat=force_rport&default_device_canreinvite=update,nonat&default_device_call_limit=9985&default_user_recording_forced_enabled=0&default_user_recording_enabled=0&default_user_currency=EUR&default_user_time_zone=Mountain Time (US %26 Canada)&default_user_call_limit=72&default_user_allow_loss_calls=0&default_user_postpaid=1&default_user_balance=102.65948&default_user_credit=-1&default_user_password_length=23&default_user_quickforwards_rule_id= | HTML POST: http://<SERVER_IP>/billing/api/conflines_update?u=admin&api_secret_key=987654321&default_user_tariff_id=2&default_device_location_id=3& | ||
default_device_video_codecs=h263&default_device_audio_codecs=ilbc,speex&default_device_grace_time=111&default_device_qualify=2356&default_device_nat=force_rport& | |||
default_device_canreinvite=update,nonat&default_device_call_limit=9985&default_user_recording_forced_enabled=0&default_user_recording_enabled=0& | |||
default_user_currency=EUR&default_user_time_zone=Mountain Time (US %26 Canada)&default_user_call_limit=72&default_user_allow_loss_calls=0&default_user_postpaid=1& | |||
default_user_balance=102.65948&default_user_credit=-1&default_user_password_length=23& | |||
default_user_quickforwards_rule_id=0hash=7c4a8d09ca3762af61e59520943dc26494f8941b | |||
<br><br> | <br><br> | ||
Line 80: | Line 91: | ||
* <error>default_device_qualify can only be 'no' or >= 1000 integer</error> | * <error>default_device_qualify can only be 'no' or >= 1000 integer</error> | ||
* <error>default_device_grace_time must be positive integer</error> | * <error>default_device_grace_time must be positive integer</error> | ||
* <error>default_device_location_id was not found</error> - Locationd with such ID was not found. | |||
* <error>default_user_tariff_id was not found</error> - Tariff with such ID was not found. | |||
* <error>allow_api must be 0 or 1</error> | * <error>allow_api must be 0 or 1</error> | ||
* <error>api_secret_key length must be higher than 5</error> | * <error>api_secret_key length must be higher than 5</error> | ||
<br><br> | <br><br> | ||
=See also= | =See also= | ||
* [[MOR API]] | * [[MOR API]] |
Latest revision as of 10:47, 27 November 2014
Description
MOR API changes settings for API, Default User or Default Device.
Usage
- Call: /api/conflines_update
- Methods: POST, GET(if allowed, not recomended)
Parameters
No parameters are included into hash. Hash is generated only using admin's API secret key.
Parameters which are not included into hash:
- u - username for authentication. Required.
- allow_api - disable api (send 0 to disable). NOTE: you can enable API only in GUI.
- api_secret_key - change API secret key.
- default_user_password_length - positive number between 6 and 30 digits.
- default_user_credit - send -1 for unlimited, 0 and bigger for amount.
- default_user_balance - send any number to change Default User Balance.
- default_user_postpaid - send 0 for prepaid, 1 - postpaid.
- default_user_allow_loss_calls - send 0 for disabled, 1 - enabled.
- default_user_call_limit - send any positive number.
- default_user_time_zone - case sensitive name of the time zone. Send only name, for example: Atlantic Time (Canada).
- default_user_currency - 3 letters code of the currency
- default_user_quickforwards_rule_id - id of the quickforward DID rule.
- default_user_recording_enabled - send 0 for disabled, 1 - enabled.
- default_user_recording_forced_enabled - send 0 for disabled, 1 - enabled.
- default_user_tariff_id - ID of existing Tariff.
- default_device_call_limit - send positive number
- default_device_canreinvite - one of these values: yes, no, nonat, update, update,nonat.
- default_device_nat - one of these values: yes, no, force_rport, comedia.
- default_device_qualify - send no or value equal 1000 or more.
- default_device_grace_time - send positive number.
- default_device_audio_codecs - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: alaw, ulaw, g723, g726, g729, gsm, ilbc, lpc10, speex, sdpcm, slin.
- default_device_video_codecs - send the name of codecs you want to have enabled. The ones not mentioned, will be turned off. Available values: h261, h263, h263p, h264.
- default_device_location_id - ID of existing Location.
- hash - SHA1 hash constructed using parameters which are listed above. 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 ( More described in Constructing hash). Required.
NOTE: reseller is not required to enable API. This method uses admin's API settings.
Additional feature
- If API setting Allow Resellers to use Admin Localization Rules is enabled, Reseller is able to set location inherited from Admin. default_device_location_id should be used as a parameter for Location.
- If API setting Allow Resellers to use Admin Quick Forward Rules is enabled, Reseller is able to set Quick Forward Rules inherited from Admin. default_user_quickforwards_rule_id should be used as a parameter for Quick Forward Rules.
- If API setting Allow Resellers to use Admin Tariffs is enabled, Reseller is able to set Tariff inherited from Admin. default_user_tariff_id should be used as a parameter for Tariff.
Request
HTML POST: http://<SERVER_IP>/billing/api/conflines_update?u=admin&api_secret_key=987654321&default_user_tariff_id=2&default_device_location_id=3& default_device_video_codecs=h263&default_device_audio_codecs=ilbc,speex&default_device_grace_time=111&default_device_qualify=2356&default_device_nat=force_rport& default_device_canreinvite=update,nonat&default_device_call_limit=9985&default_user_recording_forced_enabled=0&default_user_recording_enabled=0& default_user_currency=EUR&default_user_time_zone=Mountain Time (US %26 Canada)&default_user_call_limit=72&default_user_allow_loss_calls=0&default_user_postpaid=1& default_user_balance=102.65948&default_user_credit=-1&default_user_password_length=23& default_user_quickforwards_rule_id=0hash=7c4a8d09ca3762af61e59520943dc26494f8941b
Returns
Success
<page> <status> <success>Conflines successfully updated</success> </status> </page>
Errors
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- <error>Access Denied</error> - access not allowed.
- <error>Device was not found</error> - Device id incorrect or does not exist.
- <error>default_user_password_length must be between 6 and 30</error>
- <error>default_user_credit must be positive number or -1 for infinity</error>
- <error>default_user_balance must be number</error>
- <error>default_user_postpaid must be 0 or 1</error>
- <error>default_user_allow_loss_calls must be 0 or 1</error>
- <error>default_user_credit must be positive integer</error>
- <error>default_user_time_zone name was not correct</error>
- <error>default_user_currency name was not correct</error>
- <error>default_user_currency name was not correct</error>
- <error>default_user_quickforwards_rule_id was not found</error>
- <error>default_user_recording_enabled must be 0 or 1</error>
- <error>default_user_recording_forced_enabled must be 0 or 1</error>
- <error>default_device_call_limit must be positive integer</error>
- <error>default_device_canreinvite can only be one of the following: 'yes', 'no', 'nonat', 'update', 'update,nonat'</error>
- <error>default_device_nat can only be one of the following: 'yes', 'no', 'force_rport', 'comedia'</error>
- <error>default_device_qualify can only be 'no' or >= 1000 integer</error>
- <error>default_device_grace_time must be positive integer</error>
- <error>default_device_location_id was not found</error> - Locationd with such ID was not found.
- <error>default_user_tariff_id was not found</error> - Tariff with such ID was not found.
- <error>allow_api must be 0 or 1</error>
- <error>api_secret_key length must be higher than 5</error>