Ad Widget

Collapse

API Call is failing - any ideas why?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #1

    API Call is failing - any ideas why?

    Hi,
    I'm trying to determine a user's media type and id using the zabbix api (php). I can pull back the user's details no problem but am getting nothing for when querying medias and mediatypes:

    ZabbixAPI::fetch_array('user','get',array(
    'filter'=>array(
    'alias'=>$zbxusername,
    ),
    'select_medias'=>'extend'
    )
    )

    Note: The user account I'm testing against has an email media type configured.

    Why is "select_medias" and "select_mediatypes" not returning anything when "output" returns the kind of extended output one would expect? If someone can point me in the right direction on this I'll appreciate it greatly.


    Regards,
    David
  • Rob_
    Junior Member
    • Jul 2011
    • 5

    #2
    Hello,
    have you check your api?

    Go to:
    zabbix/api/classes/class.cuser.php

    and check if the
    'select_medias' type is available.

    It's an array called $def_options!

    Maybe this will explain your problem.

    Comment

    • Yello
      Senior Member
      • Apr 2011
      • 309

      #3
      Hi,
      Thanks for the reply. I've modified my code based on your feedback. Still no dice.

      $action_detail = ZabbixAPI::fetch_array('user','get',array(
      'filter'=>array(
      'alias'=>$zbxusername,
      ),
      'def_options'=>array(
      'select_medias'=>'extend'
      )
      )

      Am I misinterpreting your response?


      Regards,
      David

      Comment

      • Rob_
        Junior Member
        • Jul 2011
        • 5

        #4
        Hi Yello,

        my suggest was to check if your api version supports that type of filtering!
        So check the api source code!

        Greetz
        Rob

        Comment

        Working...