Difference between revisions of "MOR API ma activate api"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: | Line 1: | ||
'This functionality is available from [[MOR_9_documentation| MOR 9]]'' | |||
[[MOR API]] | |||
API activates actions that are indicated in monitoring settings. For example, sends an email. | |||
<br><br> | |||
= = | |||
<br> | |||
* Call: /api/ma_activate | * Call: /api/ma_activate | ||
* Params: | * Params: | ||
** monitoring_id - monitoring ID | ** monitoring_id - monitoring ID. '''Required'''. | ||
** users - | ** users - users' IDs. '''Required'''. | ||
** block - blocks the user | ** block - blocks the user. '''Required'''. | ||
** email - sends email about blocked user to admin | ** email - sends email about blocked user to admin. Possible values[true - send email, false - do not send email]. '''Required'''. | ||
** mtype | ** mtype - monitoring type. Possible values[1 - Increases more than, 2- Drops below than]. '''Required'''. | ||
* Returns: | |||
** Success: | |||
<status> | |||
<monitoring_found>success</monitoring_found> | |||
<users> | |||
<user> | |||
<id>2</id> | |||
<status> blocked</status> | |||
</user> | |||
</users> | |||
</status> | |||
<status> | |||
<monitoring_found>success</monitoring_found> | |||
<users> | |||
<user> | |||
<id>2</id> | |||
<status> email sent</status> | |||
</user> | |||
<user> | |||
<id>3</id> | |||
<status> email sent</status> | |||
</user> | |||
</users> | |||
</status> | |||
** Errors: | |||
*** <error>Such monitoring was not found. Verify master-slave database integrity.</error> - incorrect monitoring settings were send. | |||
*** <error>You must supply these params: monitoring_id, users, block, email, mtype</error> - not all required settings were send. | |||
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | |||
<br> | |||
---- | |||
<br> | |||
*Example: | |||
**We have user_id = 2 and user_id = 3, API Secret Key = 456789, monitoring type "Increases more than", actions selected are to block user and to send an email (email options must be configured correctly, otherwise you will get a reminder to configure them). | |||
**Hash string to be converted: "123456789" | |||
**We might send: | |||
***//api/ma_activate?u=admin&p=admin1&monitoring_id=2,3&users=123&block=true&email=true&mtype=1&hash=760990a268bfd03859b6a001ea3712ed096202ef | |||
'''* Note that username and password are not included in hash''' |
Revision as of 09:55, 23 November 2012
'This functionality is available from MOR 9
API activates actions that are indicated in monitoring settings. For example, sends an email.
- Call: /api/ma_activate
- Params:
- monitoring_id - monitoring ID. Required.
- users - users' IDs. Required.
- block - blocks the user. Required.
- email - sends email about blocked user to admin. Possible values[true - send email, false - do not send email]. Required.
- mtype - monitoring type. Possible values[1 - Increases more than, 2- Drops below than]. Required.
- Returns:
- Success:
<status> <monitoring_found>success</monitoring_found> <users> <user> <id>2</id> <status> blocked</status> </user> </users> </status>
<status> <monitoring_found>success</monitoring_found> <users> <user> <id>2</id> <status> email sent</status> </user> <user> <id>3</id> <status> email sent</status> </user> </users> </status>
- Errors:
- <error>Such monitoring was not found. Verify master-slave database integrity.</error> - incorrect monitoring settings were send.
- <error>You must supply these params: monitoring_id, users, block, email, mtype</error> - not all required settings were send.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- Errors:
- Example:
- We have user_id = 2 and user_id = 3, API Secret Key = 456789, monitoring type "Increases more than", actions selected are to block user and to send an email (email options must be configured correctly, otherwise you will get a reminder to configure them).
- Hash string to be converted: "123456789"
- We might send:
- //api/ma_activate?u=admin&p=admin1&monitoring_id=2,3&users=123&block=true&email=true&mtype=1&hash=760990a268bfd03859b6a001ea3712ed096202ef
* Note that username and password are not included in hash