Difference between revisions of "MOR API ma activate api"

From Kolmisoft Wiki
Jump to navigationJump to search
()
Line 16: Line 16:
** mtype - monitoring type. Possible values[1 - Increases more than, 2- Drops below than]. '''Required'''.
** mtype - monitoring type. Possible values[1 - Increases more than, 2- Drops below than]. '''Required'''.
* Returns:
* Returns:
** Success:
** Success: <code>
   <status>
   <status>
   <monitoring_found>success</monitoring_found>
   <monitoring_found>success</monitoring_found>
Line 26: Line 26:
   </users>
   </users>
  </status>
  </status>
 
</code><code>
  <status>
  <status>
   <monitoring_found>success</monitoring_found>
   <monitoring_found>success</monitoring_found>
Line 40: Line 40:
   </users>
   </users>
  </status>
  </status>
 
</code>
 
* Errors:
** Errors:
** <error>Such monitoring was not found. Verify master-slave database integrity.</error> - incorrect monitoring settings were sent.  
*** <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>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.
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
<br>
<br>
----
----

Revision as of 10:27, 23 November 2012

'This functionality is available from MOR 9


MOR API

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