Difference between revisions of "MOR API ma activate api"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=-------------------------------=
[[MOR API]] API activates actions that are indicated in monitoring settings. For example, sends an email.
 
<br><br>
* Call: /api/ma_activate
= =
* Call: /api/monitoring_addon_activate
<!--- Till MOR X4/X3  /api/ma_activate was used. In MOR X4/X3 both methods work -->
* Params:
* Params:
** monitoring_id - monitoring ID
** monitoring_id - monitoring ID. '''Required'''.
** users - user's ID
** 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: <code>
  <status>
  <monitoring_found>success</monitoring_found>
  <users>
    <user>
      <id>2</id>
      <status> blocked</status>
    </user>
  </users>
</status>
</code><code>
<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>
</code>
* 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.
<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/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'''

Latest revision as of 15:40, 27 May 2013

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:
 <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