Skip to content

wa calling enable

GiuFLim edited this page Sep 22, 2025 · 16 revisions

启用商户号码的calling能力

使用此接口启用商户号码的calling能力。

接口

  • URL:https://api2.nxcloud.com/api/wa/calling/enable
  • Method:POST
  • Content-Type:application/json
  • 需要鉴权:

鉴权机制

鉴权规则请参考地址:API接口调用约定

请求参数

header参数:

参数名 类型 必选 示例值 说明
accessKey String fme2na3kdi3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒
bizType String 2 WhatsApp业务类型,取固定值"2"
action String mt WhatsApp业务操作,取固定值"mt"
sign String 6e9506557d1f289501d333ee2c365826 API入参参数签名,[签名算法](

body参数:

参数名 类型 必选 示例值 说明
appkey String pem28kje 应用appkey
business_phone String 86133xxx 商户的WhatsApp号码,需要带国码。如86158xxxx1795
region String SINGAPORE 语音服务器的国家/地区
icon_status Integer 1 是否显示通话图标 1=显示 0=隐藏
permission_status Integer 1 是否提示呼叫权限请求 1启用, 0禁用
recording_status Integer 0 是否启用录音 1启用, 0禁用
hours_status Integer 0 是否定制业务时间 1启用 0禁用
hours_customize Object 定制业务时间 hours_status=1的情况下 必须有值,结构如下
customer_sip_addr Array[Object] {"host":"34.56.78.90","port":8080,"type":1} 客户SIP servers信息

customer_sip_addr Array[Object]

参数名 类型 必选 示例值 说明
host String 4.4.4.4 服务器ip地址/域名地址【目前只支持ip地址】
port Integer 8080 ip地址时必须指明端口
type Integer 1 1=呼入&呼出 2=呼入 3=呼出

hours_customize Object

定制业务时间 hours_status=1的情况下 必须有值,结构如下

参数名 类型 必选 示例值 说明
status String ENABLED 固定值 ENABLED(启用) DISABLED(禁用)
timezone_id String Etc/GMT-8 meta文档中支持的时区
weekly_operating_hours Array[Object] {"day_of_week":"MONDAY","open_time":"0400","close_time":"1020"} 自定义周一至周日可接听时间段
holiday_schedule Array[Object] 自定义假期不可接听时间段

weekly_operating_hours Array[Object]

自定义周一至周日可接听时间段

  • Maximum of 2 entries allowed per day of week
  • open_time must be before close_time
  • Overlapping entries not allowed
参数名 类型 必选 示例值 说明
day_of_week String MONDAY The day of the week. Can take one of seven values: "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"
open_time String 0400 Times represented in 24 hour format, e.g. "1130" = 11:30AM
close_time String 1020 Times represented in 24 hour format, e.g. "1130" = 11:30AM

holiday_schedule Array[Object]

自定义假期不可接听时间段

An optional override to the weekly schedule.

Up to 20 overrides can be specified.

Note: If holiday_schedule is not passed in the request, then the existing holiday_schedule will be deleted and replaced with an empty schedule.

参数名 类型 必选 示例值 说明
date String 2025-02-10 Date for which you want to specify the override.YYYY-MM-DD format.
start_time String 0400 Times represented in 24 hour format, e.g. "1130" = 11:30AM
end_time String 1020 Times represented in 24 hour format, e.g. "1130" = 11:30AM

请求示例1

{
  "appkey": "xxx",
  "business_phone": "xxx",
  "region": "SINGAPORE",
  "icon_status": 1,
  "hours_status": 0,
  "permission_status": 0,
  "recording_status": 1,
  "customer_sip_addr": [
    {
      "host": "34.56.78.90",
      "port": 8080,
      "type": 1
    },
    {
      "host": "4.4.4.4",
      "port": 3390,
      "type": 2
    }
  ]
}

请求示例2 定制业务时间

{
    "appkey": "XXX",
    "business_phone": "XXX",
    "region":"SINGAPORE",
    "icon_status": 1,
    "hours_status": 1,
    "hours_customize": {
        "status": "ENABLED",
        "timezone_id": "Etc/GMT-8",
        "weekly_operating_hours": [
            {
                "day_of_week": "MONDAY",
                "open_time": "0400",
                "close_time": "1020"
            },
            {
                "day_of_week": "TUESDAY",
                "open_time": "0108",
                "close_time": "1020"
            },
            {
                "day_of_week": "THURSDAY",
                "open_time": "0108",
                "close_time": "1020"
            }
        ],
        "holiday_schedule": [
            {
                "date": "2025-10-01",
                "start_time": "0000",
                "end_time": "0259"
            },
            {
                "date": "2025-10-02",
                "start_time": "0400",
                "end_time": "0559"
            },
            {
                "date": "2025-10-03",
                "start_time": "0800",
                "end_time": "1759"
            },
            {
                "date": "2025-10-04",
                "start_time": "2000",
                "end_time": "2359"
            }
        ]
    },
    "permission_status": 1,
    "recording_status": 1,
    "customer_sip_addr": [
    {
      "host": "34.56.78.90",
      "port": 8080,
      "type": 1
    },
    {
      "host": "4.4.4.4",
      "port": 3390,
      "type": 2
    }
  ]
}

响应参数

参数名 类型 示例值 说明
code String 0
message String Success
data Object

data Object

参数名 类型 示例值 说明
nx_sip_addr Array[Object] nx sip对接信息

nx_sip_addr Array[Object]

参数名 类型 示例值 说明
ip_list Array[String] ["34.92.169.217:6030","34.92.169.218:6030"] IP地址列表
fqdn Array[String] ["ivp-cli-cluster.nxcloud.com"] FQDN列表
region String SINGAPORE 语音站点

响应示例1

{
    "code": 0,
    "message": "Success",
    "data": {
        "nx_sip_addr": [
            {"region":"SINGAPORE","ip_list":["34.92.169.217:6030","34.92.169.218:6030"],"fqdn":["ivp-cli-cluster.nxcloud.com"]}
        ],
        "business_phone": "xxx"
    },
    "traceId": "da42a443e13c4ce39bf14728180cd4cb"
}

响应示例2

{
    "code": 10015,
    "message": "permission_status not in (0, 1)",
    "traceId": "33904fce3e5744e8bc842906967c202b"
}

响应示例3

{
    "code": 10012,
    "message": "Wa calling setting fail (#10) Business initiated calls are not supported for the phone number country. Disable callback permission status if you want to enable only user initiated calls",
    "traceId": "2527e891748e4ff694e700a4aed6f2fe"
}

简介

短信

语音

云呼叫中心(NXLink)

云呼叫中心(AI自动外呼)

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally