.. _restful-http-api-channels: Channels ======== Getting active channel list +++++++++++++++++++++++++++ .. http:get:: /api/v2/channels **Example request**: .. sourcecode:: http GET /api/v2/channels HTTP/1.1 X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c **Example response**: .. sourcecode:: http HTTP/1.1 200 OK { "status":"OK", "data":{ "row_count":1, "rows":[{ "uuid":"d16592f8-e9c2-409d-a994-13c033b282ab", "direction":"inbound", "created":"2015-09-06 20:05:11", "created_epoch":"1441569911", "name":"sofia/internal/201@10.10.10.144", "state":"CS_EXECUTE", "cid_name":"201", "cid_num":"201", "ip_addr":"93.75.208.227", "dest":"00", "application":"conference", "application_data":"10.10.10.144@video-mcu-stereo", "dialplan":"XML", "context":"default", "read_codec":"L16","read_rate":"48000", "read_bit_rate":"768000", "write_codec":"opus", "write_rate":"48000", "write_bit_rate":"0", "secure":"", "hostname":"webitel", "presence_id":"201@10.10.10.144", "presence_data":"", "callstate":"ACTIVE", "callee_name":"", "callee_num":"", "callee_direction":"", "call_uuid":"", "sent_callee_name":"", "sent_callee_num":"", "initial_cid_name":"201", "initial_cid_num":"201", "initial_ip_addr":"93.75.208.227", "initial_dest":"00", "initial_dialplan":"XML", "initial_context":"default"}] } } :reqheader X-Key and X-Access-Token: :ref:`auth-token` :statuscode 200: No error **CURL example**: :: curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1' "https://api.webitel.com:10022/api/v2/channels" Originating a new call ++++++++++++++++++++++ .. http:post:: /api/v2/channels **Example request**: .. sourcecode:: http POST /api/v2/channels HTTP/1.1 Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDIxNzkzNTh9.pKXWfzXqbp8FMbOKocNaSlT1bYq4Xqzol-0kEXOY0_s X-Key: 8fd26a17-eb28-4c74-aa6f-a3794f4f466c { "calledId":"00", "callerId": "201@10.10.10.144", "auto_answer_param": "sip_h_Call-Info=answer-after=0" } **Example response**: .. sourcecode:: http HTTP/1.1 200 OK { "status":"OK", "info":"+OK d917a647-7378-4b02-a3e6-0c24cc7feeac\n", } :