M2 API device details get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

M2 API Device (Origination Point) details get

[edit] Usage

  • Call: /api/device_details_get
  • Methods: POST, GET(if allowed, not recomended)
  • Scope: Only the System Admin and Managers (with a USERS > Connection Points permission) can use the method



[edit] Parameters

  • u – username for authentication. Required.
  • device_id – id of the device which details you want to get.
  • hash – SHA1 hash constructed using device_id and API_Secret_Key ( More described in Constructing hash). Required.

Please note that the Admin/Manager can retrieve Device details just for the Admin's Users.

[edit] Request

We have API Secret Key = 456789, device_id = 5

We send:

HTML POST: http://<SERVER_IP>/billing/api/device_details_get?u=admin&device_id=5&hash=65fd575c441513bd114b84c7dbdb01e0f2716d27

* Note that username is not included in hash

[edit] Returns

Success

<page>
<status>
 <devices>
  <device>
    <id>5</id>
    <name>103</name>
    <host>127.0.1.3</host>
    <secret></secret>
    <ipaddr>127.0.1.3</ipaddr>
    <port>5060</port>
    <accountcode>2</accountcode>
    <callerid>"103" <103></callerid>
    <username></username>
    <device_type>SIP</device_type>
    <user_id>2</user_id>
    <insecure>no</insecure>
    <description>Test Device for Admin</description>
    <timeout>60</timeout>
    <allow_duplicate_calls>0</allow_duplicate_calls>
    <call_limit>0</call_limit>
    <grace_time>0</grace_time>
    <server_id>1</server_id>
    <change_failed_code_to>0</change_failed_code_to>
    <max_timeout>0</max_timeout>
    <cps_call_limit>0</cps_call_limit>
    <cps_period>0</cps_period>
    <callerid_number_pool_id>0</callerid_number_pool_id>
    <op>1</op>
    <op_active>0</op_active>
    <op_tech_prefix></op_tech_prefix>
    <op_routing_algorithm>lcr</op_routing_algorithm>
    <op_routing_group_id>12001</op_routing_group_id>
    <op_tariff_id>2</op_tariff_id>
    <op_capacity>500</op_capacity>
    <op_src_regexp>.*</op_src_regexp>
    <op_src_deny_regexp></op_src_deny_regexp>
    <tp>0</tp>
    <tp_active>0</tp_active>
    <tp_tech_prefix></tp_tech_prefix>
    <tp_tariff_id>0</tp_tariff_id>
    <tp_capacity>500</tp_capacity>
    <tp_src_regexp></tp_src_regexp>
    <tp_src_deny_regexp></tp_src_deny_regexp>
    <custom_sip_header></custom_sip_header>
    <register>0</register>
    <interpret_busy_as_failed>0</interpret_busy_as_failed>
    <interpret_noanswer_as_failed>0</interpret_noanswer_as_failed>
    <sticky_contact>0</sticky_contact>
    <periodic_check>0</periodic_check>
    <alive>0</alive>
    <op_custom_tariff_id></op_custom_tariff_id>
    <ipaddr_range_start>0</ipaddr_range_start>
    <ipaddr_range_end>0</ipaddr_range_end>
    <op_destination_transformation> </op_destination_transformation>
    <quality_routing_id>0</quality_routing_id>
    <op_source_transformation></op_source_transformation>
    <tp_source_transformation></tp_source_transformation>
    <disable_q850>0</disable_q850>
    <forward_rpid>1</forward_rpid>
    <forward_pai>1</forward_pai>
    <bypass_media>0</bypass_media>
     <codecs>
      <audio_codecs></audio_codecs>
     </codecs>
  </device>
 </devices>
</status>
</page>




Errors

  • <error>Access Denied</error> – User was not found by such username. Make sure that username (u) is specified.
  • <error>Device was not found</error> – such device does not exist in the system or device does not belong to your scope.
  • <error>You are not authorized to manage devices</error> – Manager does not have permissions to view devices.
  • <error>You are not authorized to view this page</error> – Simple User is not authorized to view devices.
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



[edit] See also

Personal tools

Try MOR

Try M2