MOR API ma activate api
From Kolmisoft Wiki
Jump to navigationJump to search
MOR API API activates actions that are indicated in monitoring settings. For example, sends an email.
- Call: /api/monitoring_addon_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:
- 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 sent.
- <error>You must supply these params: monitoring_id, users, block, email, mtype</error> - not all required settings were sent.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- 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/monitoring_addon_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