The method allows to retrieve media types according to the given parameters.该方法允许根据给定的参数来检索媒体类型。

    Parameters参数

    (object) Parameters defining the desired output.定义所需输出的参数。

    Returns either:返回:

    • an array of objects;一组对象;

    Examples 示例

    Retrieving media types检索媒体类型

    Retrieve all configured media types.检索所有配置的媒体类型。

    Request:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "mediatypeid": "1",
    6. "type": "0",
    7. "description": "Email",
    8. "smtp_server": "mail.company.com",
    9. "smtp_email": "[email protected]",
    10. "exec_path": "",
    11. "gsm_modem": "",
    12. "username": "",
    13. "passwd": "",
    14. "status": "0"
    15. },
    16. {
    17. "mediatypeid": "2",
    18. "type": "3",
    19. "description": "Jabber",
    20. "smtp_server": "",
    21. "smtp_helo": "",
    22. "smtp_email": "",
    23. "exec_path": "",
    24. "gsm_modem": "",
    25. "username": "",
    26. "status": "0"
    27. },
    28. {
    29. "mediatypeid": "3",
    30. "type": "2",
    31. "description": "SMS",
    32. "smtp_server": "",
    33. "smtp_helo": "",
    34. "smtp_email": "",
    35. "exec_path": "",
    36. "gsm_modem": "/dev/ttyS0",
    37. "username": "",
    38. "passwd": "",
    39. "status": "0"
    40. }
    41. ],
    42. "id": 1

    Source来源

    CMediaType::get() in frontends/php/include/classes/api/services/CMediaType.php.