Difference between revisions of "MOR API Subscriptions get"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '= NOTE: Available from MOR X5 = =Description= MOR API Subscriptions get <br><br> =Usage= * From '''MOR X5''' Call: '''/api/subscriptions_get''' * Methods: POST, GET(if allo…') |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 13: | Line 13: | ||
* u - username for authentication. '''Required'''. | * u - username for authentication. '''Required'''. | ||
* service_id - Subscription's Service id. | * service_id - Subscription's Service id. | ||
* subscription_activation_start - Subscription's Activation Start timestamp in System Time Zone (if | * subscription_activation_start - Subscription's Activation Start timestamp in System Time Zone (if defined - only time equal to it or after it). | ||
* subscription_activation_end - Subscription's Activation End timestamp in System Time Zone (if | * subscription_activation_end - Subscription's Activation End timestamp in System Time Zone (if defined - only time equal to it or before it). | ||
* subscription_memo - Subscription's memo. | * subscription_memo - Subscription's memo. | ||
* subscription_until_canceled - defines if Subscription can be Until canceled - can not to have Activation End (0 - off, 1 - on, default - off). | * subscription_until_canceled - defines if Subscription can be Until canceled - can not to have Activation End (0 - off, 1 - on, default - off). | ||
Line 20: | Line 20: | ||
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | * [[MOR API hash construction | hash]] - SHA1 hash constructed using '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | ||
<br><br> | <br><br> | ||
===Request=== | ===Request=== | ||
Line 26: | Line 27: | ||
We send: | We send: | ||
HTML POST: http://<SERVER_IP>/billing/api/subscriptions_get?&u=admin&service_id=2&subscription_activation_start=1307167264&subscription_activation_end=1307167265 | HTML POST: http://<SERVER_IP>/billing/api/subscriptions_get?&u=admin&service_id=2&subscription_activation_start=1307167264&subscription_activation_end=1307167265 | ||
&subscription_memo=Subscriptions memo&subscription_until_canceled=1&user_id=2 | &subscription_memo=Subscriptions memo&subscription_until_canceled=1&user_id=2&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4 | ||
'''NOTE that username is not included in hash''' | '''NOTE that username is not included in hash''' | ||
<br><br> | <br><br> | ||
Line 36: | Line 37: | ||
<subscriptions> | <subscriptions> | ||
<subscription> | <subscription> | ||
<id>231</id> | |||
<user>Test User #1</user> | <user>Test User #1</user> | ||
<device></device> | <device></device> | ||
Line 43: | Line 45: | ||
<time_left></time_left> | <time_left></time_left> | ||
<memo>Subscriptions memo</memo> | <memo>Subscriptions memo</memo> | ||
<type>Subscription type</type> | |||
<price></price> | |||
<user_id></user_id> | |||
</subscription> | </subscription> | ||
</subscriptions> | </subscriptions> | ||
Line 59: | Line 64: | ||
* [[MOR API]] | * [[MOR API]] | ||
* [[MOR API subscription delete]] | |||
* [[MOR API subscription create]] | |||
* [[MOR API subscription update]] |
Latest revision as of 09:05, 7 February 2020
NOTE: Available from MOR X5
Description
MOR API Subscriptions get
Usage
- From MOR X5 Call: /api/subscriptions_get
- Methods: POST, GET(if allowed, not recomended)
Parametres
- u - username for authentication. Required.
- service_id - Subscription's Service id.
- subscription_activation_start - Subscription's Activation Start timestamp in System Time Zone (if defined - only time equal to it or after it).
- subscription_activation_end - Subscription's Activation End timestamp in System Time Zone (if defined - only time equal to it or before it).
- subscription_memo - Subscription's memo.
- subscription_until_canceled - defines if Subscription can be Until canceled - can not to have Activation End (0 - off, 1 - on, default - off).
- user_id - Subscription's User id
- hash - SHA1 hash constructed using API_Secret_Key ( More described in Constructing hash). Required.
Request
We have: API Secret Key = secret
We send:
HTML POST: http://<SERVER_IP>/billing/api/subscriptions_get?&u=admin&service_id=2&subscription_activation_start=1307167264&subscription_activation_end=1307167265 &subscription_memo=Subscriptions memo&subscription_until_canceled=1&user_id=2&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
NOTE that username is not included in hash
Success
<page> <status> <subscriptions> <subscription> <id>231</id> <user>Test User #1</user> <device></device> <service>Service Name</service> <from>2011-06-04 06:01:04 +0200</from> <till></till> <time_left></time_left> <memo>Subscriptions memo</memo> <type>Subscription type</type> <price></price> <user_id></user_id> </subscription> </subscriptions> </status> </page>
Errors
- <error>No Subscriptions found</error> - Subscription was not found using specified params. Use correct params.
- <error>You are not authorized to manage Subscriptions</error> - Such username does not exist in the database or User does not have rights to manage Subscriptions.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key while concatenating hash_string.