Skip to content

SAAS saas_plat openapi batch_create

zjc1750514326 edited this page Apr 3, 2023 · 29 revisions

批量创建客户

批量创建客户

  • URL:https://api.nxcloud.com/saas_plat/openapi/batch_create
  • 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参数:

参数名 类型 必选 示例值 说明
type integer 1 0:放弃旧数据,使用新数据 1:基于旧数据更新/增加数据项目 2:保留旧数据、放弃新数据
tenant_id integer 123 租户id
customers array whatsapp 批量创建,单次限制100
tags array[integer] - 标签ID列表
remark String - remark 最大长度100个字符
time_zone String - 时区
gender integer - 性别,1男, 0 女
customize_field String - 自定义字段数据

消息类型

  • customers参数:
参数名 类型 必选 示例值 说明
first_name String - First Name最大长度为128字符
last_name String - Last Name最大长度为128字符
sms_phone String - 手机号码最大长度为30字符
whats_app_phone String - WhatsApp最大长度为30字符
country String - 国家 最大长度为50字符
email String - 邮箱最大长度为50字符
address String - -
birthday String - 生日 yyyy-MM-dd
source String - 来源最大长度50个字符

请求示例

批量发送请求示例

body(application/json) 参数:

{
    "type": 46,
    "tenant_id": 28,
    "customers": [
        {
            "first_name": "影传她称又",
            "last_name": "目克快近段加整",
            "sms_phone": "18163725558",
            "whats_app_phone": "18667728886",
            "country": "nisi aute ex do",
            "email": "[email protected]",
            "address": "贵州省威海市东坡区",
            "birthday": "1976-04-12",
            "source": "voluptate Excepteur",
            "tags": [
                62,
                49,
                84,
                94
            ],
            "remark": "nisi amet",
            "time_zone": "2000-03-14 21:53:04",
            "gender": 65,
            "customize_field": "officia in qui"
        },
        {
            "first_name": "派样区学",
            "last_name": "个圆处型图具保",
            "sms_phone": "18135539411",
            "whats_app_phone": "18178516529",
            "country": "irure ad adipisicing sed",
            "email": "[email protected]",
            "address": "福建省泰安市武进区",
            "birthday": "2015-08-19",
            "source": "aliquip laboris dolore",
            "tags": [
                68,
                10,
                9
            ],
            "remark": "ut",
            "time_zone": "1979-06-15 03:11:42",
            "gender": 77,
            "customize_field": "nulla"
        },
        {
            "first_name": "少展干到易而",
            "last_name": "已属立容所",
            "sms_phone": "19823124108",
            "whats_app_phone": "13876316130",
            "country": "ad voluptate cupidatat nulla",
            "email": "[email protected]",
            "address": "江西省营口市其它区",
            "birthday": "1981-03-26",
            "source": "in cupidatat enim sunt pariatur",
            "tags": [
                92,
                11,
                68,
                85
            ],
            "remark": "velit commodo Lorem",
            "time_zone": "2007-02-04 04:30:02",
            "gender": 59,
            "customize_field": "dolor"
        },
        {
            "first_name": "面想书教华",
            "last_name": "导六话导选",
            "sms_phone": "18626386809",
            "whats_app_phone": "18692774567",
            "country": "dolor fugiat esse",
            "email": "[email protected]",
            "address": "山西省吐鲁番地区勐海县",
            "birthday": "1975-07-27",
            "source": "pariatur",
            "tags": [
                60,
                22,
                83,
                96
            ],
            "remark": "officia anim mollit cupidatat dolor",
            "time_zone": "2006-03-07 22:00:44",
            "gender": 16,
            "customize_field": "est consectetur dolor irure"
        },
        {
            "first_name": "道见况包信",
            "last_name": "本备到广",
            "sms_phone": "18669376513",
            "whats_app_phone": "13110670522",
            "country": "nisi in in ea",
            "email": "[email protected]",
            "address": "江苏省舟山市埇桥区",
            "birthday": "2015-02-17",
            "source": "consectetur velit",
            "tags": [
                71,
                96
            ],
            "remark": "qui",
            "time_zone": "1991-05-26 15:39:17",
            "gender": 79,
            "customize_field": "incididunt ut in tempor velit"
        }
    ]
}

响应参数

参数名 类型 说明
code Integer 结果编码
data JsonObject 请求结果
message String 请求结果说明
traceId String 链路追踪ID
  • data object参数:
参数名 类型 说明
message_id String 消息ID

响应示例

成功示例

{
	"code": 0,
	"message": "",
	"data": {
		"message_id": "gBGGhSNXV1dfAglVQ0RRuE3YWhc"
	},
	"traceId": "56bf81643292cd6a89ecde64ae00db13"
}

响应码说明

code message 解决办法
0 请求成功
-1 请求失败 请联系技术人员排除问题
1000~100X 鉴权问题 详情查看API鉴权部分
21058 参数异常 tenant_id 必填
21059 参数异常 app_key 必填
21060 参数异常 business_phone 必填
21061 参数异常 to (接受方号码) 必填
21062 参数异常 type 必填,可选值[template]
21063 参数异常 template 必填
22020 业务异常 客户不存在
22041 业务异常 云平台发送失败
22042 业务异常 发送WhatsApp信息失败
22049 业务异常 business_phone={0}的商户不存在
22089 业务异常 号码不可用(No Core App)
22090 业务异常 非法的号码
22091 业务异常 非WhatsApp用户
22092 业务异常 不存在语言包: {0}
22093 业务异常 模板不存在
22123 业务异常 商户手机号错误
22124 业务异常 应用不存在/不可用
22122 业务异常 应用没有对应国家报价
22125 业务异常 账号余额不足
22126 业务异常 该whatsapp号码未绑定应用

模板语言

语言 代码   语言 代码   语言 代码
Afrikaans af   Greek el   Portuguese (BR) pt_BR
Albanian sq   Gujarati gu   Portuguese (POR) pt_PT
Arabic ar   Hebrew he   Punjabi pa
Azerbaijani az   Hindi hi   Romanian ro
Bengali bn   Hungarian hu   Russian ru
Bulgarian bg   Indonesian id   Serbian sr
Catalan ca   Irish ga   Slovak sk
Chinese (CHN) zh_CN   Italian it   Slovenian sl
Chinese (HKG) zh_HK   Japanese ja   Spanish es
Chinese (TAI) zh_TW   Kannada kn   Spanish (ARG) es_AR
Croatian hr   Kazakh kk   Spanish (SPA) es_ES
Czech cs   Korean ko   Spanish (MEX) es_MX
Danish da   Lao lo   Swahili sw
Dutch nl   Latvian lv   Swedish sv
English en   Lithuanian lt   Tamil ta
English (UK) en_GB   Macedonian mk   Telugu te
English (US) en_US   Malay ms   Thai th
Estonian et   Marathi mr   Turkish tr
Filipino fil   Norwegian nb   Ukrainian uk
Finnish fi   Persian fa   Urdu ur
French fr   Polish pl   Uzbek uz
German de         Vietnamese vi

简介

短信

语音

云呼叫中心(NXLink)

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

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally