“插件http接口”的版本间的差异

来自uucall
跳转至: 导航搜索
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
 
== 手动外呼 ==
 
== 手动外呼 ==
=== 说明 ===
+
* <big>说明</big>
接口类型:HTTP请求<br />
+
接口类型:HTTP请求<br />
接口使用账户:企业账户<br />
+
接口使用账户:企业账户<br />
接口地址:localhost\127.0.0.1<br />
+
接口地址:localhost\127.0.0.1<br />
接口返回值:JSON格式返回结果<br />
+
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
 
  Function xxxxx() {
 
  Function xxxxx() {
 
     var callAjax =$.ajax({
 
     var callAjax =$.ajax({
第22行: 第22行:
 
  }
 
  }
  
=== 参数说明 ===
+
* <big>参数说明</big>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
第37行: 第37行:
 
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 
|}
 
|}
 
+
<br />
=== 响应 ===
+
* <big>响应</big>
 
返回JSON格式数据:{result:返回结果, msg:描述}
 
返回JSON格式数据:{result:返回结果, msg:描述}
 
{| class="wikitable"
 
{| class="wikitable"
第50行: 第50行:
 
| client_type_error || 客户端类型错误(不是使用的web插件)
 
| client_type_error || 客户端类型错误(不是使用的web插件)
 
|}
 
|}
 
+
<br />
 
== 一键外呼 ==
 
== 一键外呼 ==
=== 说明 ===
+
* <big>说明</big>
接口类型:HTTP请求<br />
+
接口类型:HTTP请求<br />
接口使用账户:企业账户<br />
+
接口使用账户:企业账户<br />
接口地址:localhost\127.0.0.1<br />
+
接口地址:localhost\127.0.0.1<br />
接口返回值:JSON格式返回结果<br />
+
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
=== 参数说明 ===
+
Function xxxxx() {
=== 响应 ===
+
    var callAjax =$.ajax({
 +
      url: 'http://127.0.0.1:12307?cmd=onekey_dial_out&jsonpcallback=?',
 +
      dataType: 'JSONP',
 +
      time: 5000,
 +
      error:function(json){
 +
      },
 +
      success:function(json){
 +
            if(json.result == ' success '){
 +
            }else if(json.result == ' ext_offline '){
 +
            }else if(json.result == ' client_type_error '){
 +
            }
 +
        }
 +
  });
 +
}
  
 +
* <big>参数说明</big>
 +
{| class="wikitable"
 +
|-
 +
! 类型 !! 参数名 !! 描述 !! 是否必填 !! 数据类型 !! 固定值
 +
|-
 +
| 参数 || localhost || 本机地址 || true || string || 127.0.0.1
 +
|-
 +
| 参数 || port || 端口 || true || string || 12307
 +
|-
 +
| 参数 || cmd || 执行动作,一键外呼 || true || string || onekey_dial_out
 +
|-
 +
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 +
|}
 +
<br />* <big>响应</big>
 +
返回JSON格式数据:{result:返回结果, msg:描述}
 +
{| class="wikitable"
 +
|-
 +
! result !! msg
 +
|-
 +
| success || 操作成功
 +
|-
 +
| failed || 操作失败
 +
|-
 +
| ext_offline || 分机未登录
 +
|-
 +
| client_type_error || 客户端类型错误(不是使用的web插件)
 +
|}
 +
<br />
 
== 挂断电话 ==
 
== 挂断电话 ==
=== 说明 ===
+
* <big>说明</big>
接口类型:HTTP请求<br />
+
接口类型:HTTP请求<br />
接口使用账户:企业账户<br />
+
接口使用账户:企业账户<br />
接口地址:localhost\127.0.0.1<br />
+
接口地址:localhost\127.0.0.1<br />
接口返回值:JSON格式返回结果<br />
+
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
=== 参数说明 ===
+
Function xxxxx() {
=== 响应 ===
+
    var callAjax =$.ajax({
 +
      url: ' http://127.0.0.1:12307?cmd=huang_up&jsonpcallback=?',
 +
      dataType: 'JSONP',
 +
      time: 5000,
 +
      error:function(json){
 +
      },
 +
      success:function(json){
 +
            if(json.result == ' success '){
 +
            }else if(json.result == ' ext_offline '){
 +
            }else if(json.result == ' client_type_error '){
 +
            }
 +
        }
 +
  });
 +
}
  
 +
* <big>参数说明</big>
 +
{| class="wikitable"
 +
|-
 +
! 类型 !! 参数名 !! 描述 !! 是否必填 !! 数据类型 !! 固定值
 +
|-
 +
| 参数 || localhost || 本机地址 || true || string || 127.0.0.1
 +
|-
 +
| 参数 || port || 端口 || true || string || 12307
 +
|-
 +
| 参数 || cmd || 执行动作,挂断电话 || true || string || huang_up
 +
|-
 +
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 +
|}
 +
<br />* <big>响应</big>
 +
返回JSON格式数据:{result:返回结果, msg:描述}
 +
{| class="wikitable"
 +
|-
 +
! result !! msg
 +
|-
 +
| success || 操作成功
 +
|-
 +
| ext_offline || 分机未登录
 +
|-
 +
| client_type_error || 客户端类型错误(不是使用的web插件)
 +
|}
 +
<br />
 
== 接听电话 ==
 
== 接听电话 ==
=== 说明 ===
+
* <big>说明</big>
接口类型:HTTP请求<br />
+
接口类型:HTTP请求<br />
接口使用账户:企业账户<br />
+
接口使用账户:企业账户<br />
接口地址:localhost\127.0.0.1<br />
+
接口地址:localhost\127.0.0.1<br />
接口返回值:JSON格式返回结果<br />
+
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
=== 参数说明 ===
+
Function xxxxx() {
=== 响应 ===
+
    var callAjax =$.ajax({
 +
      url: ' http://127.0.0.1:12307?cmd=answer&jsonpcallback=?',
 +
      dataType: 'JSONP',
 +
      time: 5000,
 +
      error:function(json){
 +
      },
 +
      success:function(json){
 +
            if(json.result == ' success '){
 +
            }else if(json.result == ' ext_offline '){
 +
            }else if(json.result == ' client_type_error '){
 +
            }
 +
        }
 +
  });
 +
}
  
 +
* <big>参数说明</big>
 +
{| class="wikitable"
 +
|-
 +
! 类型 !! 参数名 !! 描述 !! 是否必填 !! 数据类型 !! 固定值
 +
|-
 +
| 参数 || localhost || 本机地址 || true || string || 127.0.0.1
 +
|-
 +
| 参数 || port || 端口 || true || string || 12307
 +
|-
 +
| 参数 || cmd || 执行动作,接听电话 || true || string || answer
 +
|-
 +
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 +
|}
 +
<br />* <big>响应</big>
 +
返回JSON格式数据:{result:返回结果, msg:描述}
 +
{| class="wikitable"
 +
|-
 +
! result !! msg
 +
|-
 +
| success || 操作成功
 +
|-
 +
| ext_offline || 分机未登录
 +
|-
 +
| client_type_error || 客户端类型错误(不是使用的web插件)
 +
|}
 +
<br />
 
== 电话转接 ==
 
== 电话转接 ==
=== 说明 ===
+
* <big>说明</big>
 
接口类型:HTTP请求<br />
 
接口类型:HTTP请求<br />
 
接口使用账户:企业账户<br />
 
接口使用账户:企业账户<br />
 
接口地址:localhost\127.0.0.1<br />
 
接口地址:localhost\127.0.0.1<br />
 
接口返回值:JSON格式返回结果<br />
 
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
=== 参数说明 ===
+
Function xxxxx() {
=== 响应 ===
+
    var callAjax =$.ajax({
 +
      url: ' http://127.0.0.1:12307?cmd=transfer_to&trans_type=number&trans_ivr=0133xxxxxxxx&jsonpcallback=?',
 +
      dataType: 'JSONP',
 +
      time: 5000,
 +
      error:function(json){
 +
      },
 +
      success:function(json){
 +
            if(json.result == ' success '){
 +
            }else if(json.result == ' ext_offline '){
 +
            }else if(json.result == ' client_type_error '){
 +
            }
 +
        }
 +
  });
 +
}
  
== 发生按键 ==
+
* <big>参数说明</big>
=== 说明 ===
+
{| class="wikitable"
 +
|-
 +
! 类型 !! 参数名 !! 描述 !! 是否必填 !! 数据类型 !! 固定值
 +
|-
 +
| 参数 || localhost || 本机地址 || true || string || 127.0.0.1
 +
|-
 +
| 参数 || port || 端口 || true || string || 12307
 +
|-
 +
| 参数 || cmd || 执行动作,电话转接 || true || string || transfer_to
 +
|-
 +
| 参数 || trans_type || 转接类型 || true || string || trans_number/trans_queue/trans_ext/trans_ivr
 +
|-
 +
| 附加参数 || trans_queue || 转接队列名称,trans_type值为queue时是附加参数 || false || string || 无
 +
|-
 +
| 附加参数 || trans_ext || 转接分机名称(1001…..),trans_type值为ext时是附加参数 || true || string || 无
 +
|-
 +
| 附加参数 || trans_number || 转接号码,trans_type值为number时是附加参数 || true || string || 无
 +
|-
 +
| 附加参数 || trans_ivr || 转接IVR名称,trans_type值为ivr时是附加参数 || true || string || 无
 +
|-
 +
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 +
|}
 +
<br />* <big>响应</big>
 +
返回JSON格式数据:{result:返回结果, msg:描述}
 +
{| class="wikitable"
 +
|-
 +
! result !! msg
 +
|-
 +
| success || 操作成功
 +
|-
 +
| failed || 操作失败
 +
|-
 +
| ext_offline || 分机未登录
 +
|-
 +
| queue_error || 队列错误
 +
|-
 +
| ext_error || 分机错误
 +
|-
 +
| ivr_error || ivr错误
 +
|}
 +
<br />== 发生按键 ==
 +
* <big>说明</big>
 
接口类型:HTTP请求<br />
 
接口类型:HTTP请求<br />
 
接口使用账户:企业账户<br />
 
接口使用账户:企业账户<br />
 
接口地址:localhost\127.0.0.1<br />
 
接口地址:localhost\127.0.0.1<br />
 
接口返回值:JSON格式返回结果<br />
 
接口返回值:JSON格式返回结果<br />
=== 示例及代码 ===
+
* <big>示例及代码</big>
=== 参数说明 ===
+
Function xxxxx() {
=== 响应 ===
+
    var callAjax =$.ajax({
 +
      url: ' http://127.0.0.1:12307?cmd=send_dtmf&dtmf=1&jsonpcallback=?',
 +
      dataType: 'JSONP',
 +
      time: 5000,
 +
      error:function(json){
 +
      },
 +
      success:function(json){
 +
            if(json.result == ' success '){
 +
            }else if(json.result == ' ext_offline '){
 +
            }else if(json.result == ' client_type_error '){
 +
            }
 +
        }
 +
  });
 +
}
 +
 
 +
* <big>参数说明</big>
 +
{| class="wikitable"
 +
|-
 +
! 类型 !! 参数名 !! 描述 !! 是否必填 !! 数据类型 !! 固定值
 +
|-
 +
| 参数 || localhost || 本机地址 || true || string || 127.0.0.1
 +
|-
 +
| 参数 || port || 端口 || true || string || 12307
 +
|-
 +
| 参数 || cmd || 执行动作,发送按键 || true || string || send_dtmf
 +
|-
 +
| 参数 || dtmf || 按键 || true || string || 1,2,3,4,5,6,7,8,9,0,*,#
 +
|-
 +
| 参数 || jsonpcallback || 回调函数设置,返回的JSON数据所在函数 || true || string || 无
 +
|}
 +
<br />* <big>响应</big>
 +
返回JSON格式数据:{result:返回结果, msg:描述}
 +
{| class="wikitable"
 +
|-
 +
! result !! msg
 +
|-
 +
| success || 操作成功
 +
|-
 +
| ext_offline || 分机未登录
 +
|-
 +
| client_type_error || 客户端类型错误(不是使用的web插件)
 +
|}
 +
<br />

2016年4月25日 (一) 17:04的最新版本

手动外呼

  • 说明
接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果
  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: 'http://127.0.0.1:12307?cmd=dial_out&dial_number=0133xxxxxxxx&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,手动外呼 true string dial_out
参数 dial_number 电话号码 true string
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


  • 响应

返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
ext_offline 分机未登录
client_type_error 客户端类型错误(不是使用的web插件)


一键外呼

  • 说明
接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果
  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: 'http://127.0.0.1:12307?cmd=onekey_dial_out&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,一键外呼 true string onekey_dial_out
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


* 响应 返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
failed 操作失败
ext_offline 分机未登录
client_type_error 客户端类型错误(不是使用的web插件)


挂断电话

  • 说明
接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果
  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: ' http://127.0.0.1:12307?cmd=huang_up&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,挂断电话 true string huang_up
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


* 响应 返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
ext_offline 分机未登录
client_type_error 客户端类型错误(不是使用的web插件)


接听电话

  • 说明
接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果
  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: ' http://127.0.0.1:12307?cmd=answer&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,接听电话 true string answer
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


* 响应 返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
ext_offline 分机未登录
client_type_error 客户端类型错误(不是使用的web插件)


电话转接

  • 说明

接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果

  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: ' http://127.0.0.1:12307?cmd=transfer_to&trans_type=number&trans_ivr=0133xxxxxxxx&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,电话转接 true string transfer_to
参数 trans_type 转接类型 true string trans_number/trans_queue/trans_ext/trans_ivr
附加参数 trans_queue 转接队列名称,trans_type值为queue时是附加参数 false string
附加参数 trans_ext 转接分机名称(1001…..),trans_type值为ext时是附加参数 true string
附加参数 trans_number 转接号码,trans_type值为number时是附加参数 true string
附加参数 trans_ivr 转接IVR名称,trans_type值为ivr时是附加参数 true string
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


* 响应 返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
failed 操作失败
ext_offline 分机未登录
queue_error 队列错误
ext_error 分机错误
ivr_error ivr错误


== 发生按键 ==

  • 说明

接口类型:HTTP请求
接口使用账户:企业账户
接口地址:localhost\127.0.0.1
接口返回值:JSON格式返回结果

  • 示例及代码
Function xxxxx() {
   var callAjax =$.ajax({
      url: ' http://127.0.0.1:12307?cmd=send_dtmf&dtmf=1&jsonpcallback=?',
      dataType: 'JSONP',
      time: 5000,
      error:function(json){
      },
      success:function(json){
           if(json.result == ' success '){
           }else if(json.result == ' ext_offline '){
           }else if(json.result == ' client_type_error '){
           }
       }
  });
}
  • 参数说明
类型 参数名 描述 是否必填 数据类型 固定值
参数 localhost 本机地址 true string 127.0.0.1
参数 port 端口 true string 12307
参数 cmd 执行动作,发送按键 true string send_dtmf
参数 dtmf 按键 true string 1,2,3,4,5,6,7,8,9,0,*,#
参数 jsonpcallback 回调函数设置,返回的JSON数据所在函数 true string


* 响应 返回JSON格式数据:{result:返回结果, msg:描述}

result msg
success 操作成功
ext_offline 分机未登录
client_type_error 客户端类型错误(不是使用的web插件)