字母数字发件人 ID
运营商网络能力:支持预注册
注册要求:Ncell 和 巴哈马 whatsapp 数据 网络均需预注册。需要提供文件和业务验证。
发件人 ID 保存:是,适用于预注册 ID;未注册的 ID 将被通用字母数字发件人 ID 覆盖
长代码
国内与国际:不支持国内长代码;支持国际长代码,但有限制
发件人 ID 保存:否,数字发件人 ID 通常会被覆盖 eeat 的不同级别
配置时间:国内不适用,国际立即
适用 用例:不建议用于主要消息传递;最好使用预先注册的字母数字发件人 ID
短代码
支持:尼泊尔目前不支持
配置时间:N/A
使用案例:N/A
受限制的短信内容、行业和用例
以下内容类型和行业面临限制:
-
-
- 赌博和博彩服务
- 成人内容或露骨内容
- 未经授权的金融服务
- 未经适当授权的政治信息
- 社交邀请(明确禁止)
-
内容过滤
已知运营商过滤规则:
-
-
- 包含与限制行业相关的某些关键字的邮件
- 来自可疑或列入黑名单的域名的 URL
- 看似冒充金融机构的邮件
-
避免阻塞的提示:
-
-
- 避免过多的标点符号和特殊字符
- 使用已注册并获批准的发件人 ID
- 保留来自信誉良好的域名的 URL
- 保持一致的发送模式
-
在尼泊尔发送短信的最佳做法
信息传递策略
-
-
- 尽可能将消息控制在 160 个字符以内 企业对企业数据库
- 包含明确的号召性用语
- 慎重使用个性化信息(例如收件人的姓名)
- 在各个信息中保持品牌的一致性
-
发送频率和时间
-
-
- 将每位收件人每周的营销信息限制为 2-3 条
- 尊重当地节假日和节日
- 在工作时间内安排消息
- 分散批量发送以避免网络拥塞
-
本土化
-
-
- 支持英语和尼泊尔语言
- 使用 Unicode (UCS-2) 编码尼泊尔语文字
- 考虑使用地方方言进行有针对性的宣传
- 在选择加入流程中加入语言偏好
-
退出管理
-
-
- 24 小时内处理退出
- 维护集中退出数据库
- 通过最后一条消息确认退出
- 定期审核退出名单的合规性
-
测试和监控
-
-
- 在两家主要运营商(Ncell 和 Nepal Telecom)上测试消息
- 监控承运商的运送费率
- 跟踪参与度指标和退出率
- 定期测试选择退出功能
-
尼泊尔的 SMS API 集成
Twilio
Twilio 提供强大的 SMS API,专门支持尼泊尔的消息传递要求。身份验证使用帐户 SID 和身份验证令牌,并提供特定于区域的端点。
import { Twilio } from 'twilio';
// Initialize Twilio client with credentials
const client = new Twilio(
process.env.TWILIO_ACCOUNT_SID,
process.env.TWILIO_AUTH_TOKEN
);
async function sendSMSToNepal(
to: string,
message: string,
alphanumericSenderId: string
) {
try {
// Ensure phone number is in E.164 format for Nepal (+977)
const formattedNumber = to.startsWith('+977') ? to : `+977${to}`;
const response = await client.messages.create({
body: message,
from: alphanumericSenderId, // Pre-registered sender ID
to: formattedNumber,
// Optional parameters for delivery tracking
statusCallback: 'https://your-webhook.com/status'
});
console.log(`Message sent successfully! SID: ${response.sid}`);
return response;
} catch (error) {
console.error('Error sending message:', error);
throw error;
}
}
辛奇
Sinch 为尼泊尔提供全面的短信功能,支持预先注册的发件人 ID 和递送报告。
import axios from 'axios';
class SinchSMSService {
private readonly baseUrl: string;
private readonly apiToken: string;
private readonly servicePlanId: string;
constructor(servicePlanId: string, apiToken: string) {
this.baseUrl = 'https://sms.api.sinch.com/xms/v1';
this.apiToken = apiToken;
this.servicePlanId = servicePlanId;
}
async sendSMS(to: string, message: string, senderId: string) {
try {
const response = await axios.post(
`${this.baseUrl}/${this.servicePlanId}/batches`,
{
from: senderId,
to: [to],
body: message,
delivery_report: 'summary'
},
{
headers: {
'Authorization': `Bearer ${this.apiToken}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
} catch (error) {
console.error('Sinch SMS Error:', error);
throw error;
}
}
}
鸟
Bird 的 API 为尼泊尔提供了简化的短信功能,支持英语和尼泊尔语文本。
import axios from 'axios';
interface BirdSMSConfig {
workspaceId: string;
channelId: string;
accessKey: string;
}
class BirdSMSService {
private readonly config: BirdSMSConfig;
constructor(config: BirdSMSConfig) {
this.config = config;
}
async sendSMS(phoneNumber: string, messageText: string) {
const url = `https://api.bird.com/workspaces/${this.config.workspaceId}/channels/${this.config.channelId}/messages`;
try {
const response = await axios.post(
url,
{
receiver: {
contacts: [{ identifierValue: phoneNumber }]
},
body: {
type: 'text',
text: { text: messageText }
}
},
{
headers: {
'Authorization': `AccessKey ${this.config.accessKey}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
} catch (error) {
console.error('Bird SMS Error:', error);
throw error;
}
}
}
API 速率限制和吞吐量
尼泊尔的运营商实施各种费率限制:
-
-
- 每秒最大消息数:每个发件人 ID 每秒 10-20 条消息
- 每日限额:因承运商和发件人 ID 类型而异
- 并发请求:通常限制为 5-10 个同时连接
-
大规模发送策略:
-
-
- 实现排队系统(Redis/RabbitMQ)
- 使用指数退避算法进行重试
- 尽可能批量发送消息
- 在多个发送者 ID 之间分配负载
-
错误处理和报告
常见错误情况:
-
-
- 发件人 ID 无效(需要预先注册)
- 网络拥塞
- 电话号码格式无效
- 内容过滤触发器
-
记录最佳实践:
interface SMSLogEntry {
messageId: string;
timestamp: Date;
recipient: string;
status: 'sent' | 'failed' | 'delivered';
errorCode?: string;
errorMessage?: string;
}
// Example logging implementation
async function logSMSActivity(entry: SMSLogEntry) {
// Log to your preferred storage (database/monitoring system)
console.log(JSON.stringify(entry));
}
回顾和其他资源
关键要点
-
-
- 合规重点:
- 预先注册发件人 ID
- 维护退出列表
- 尊重时区限制
- 技术考虑:
- 使用正确的字符编码
- 实施重试机制
- 监控配送率
- 最佳实践:
- 本地化内容
- 跨运营商测试
- 维护适当的文件
- 合规重点:
-
下一步
-
- 技术设置:
- 在首选短信提供商处注册
- 建立监控系统
- 实施错误处理
- 遵守:
- 审查 NTA 法规
- 记录同意流程
- 设置退出处理
- 测试:
- 验证发件人 ID 注册。
- 技术设置: