Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


api:user:addmedia

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

api:user:addmedia [2014/09/25 14:40] (current)
sasha Page moved from 1.8:api:user:addmedia to api:user:addmedia
Line 1: Line 1:
 +===== addMedia() =====
 +Available since version: **1.8**\\
  
 +==== Parameters ====
 +Multidimensional array with user data and user media data.\\
 +
 +^Parameter^Type^Optional^Description^Details^
 +|**users**|//​array//​| ​ |User objects to update ​ | |
 +|**medias**|//​array//​| Yes |Media objects, which should be added to users. ​ | |
 +
 +==== Returns =====
 +^Parameter^Description^
 +|**result**|Operation successful. Result will contain an array of updated user IDs.  |
 +|**error**|In case of any errors. ​ |
 +
 +==== Example ====
 +Add two enabled media to user with **ID** "​100100000010092"​
 +<​code>​
 +{
 +"​jsonrpc":"​2.0",​
 +"​method":"​user.addMedia",​
 +"​params":​{ ​
 +"​users":​ [
 +  { "​userid":​ "​100100000010092"​ }
 +],
 +"​medias":​ [
 +  {"​mediatypeid":​ "​100100000000001",​ "​sendto":​ "​[email protected]",​ "​active":​ "​0",​ "​severity":​ "​56",​ "​period":​ "​5-7,​09:​00-17:​00;"​},​
 +  {"​mediatypeid":​ "​100100000000002",​ "​sendto":​ "​[email protected]",​ "​active":​ "​0",​ "​severity":​ "​63",​ "​period":​ "​1-5,​07:​00-19:​00;"​}
 +]
 +},
 +"​auth":"​f223adf833b2bf2ff38574a67bba6372",​
 +"​id":​2
 +}
 +</​code>​
 +
 +User media added successfully:​
 +
 +<​code>​
 +{
 +"​jsonrpc":"​2.0",​
 +"​result":​{
 +   "​userids":​["​100100000010092"​]
 +},
 +"​id":​2
 +}
 +</​code>​