用途:该技能以 curl 命令封装 Telnyx Verify 与号码查询接口,用于电话号码数据丰富化和用户身份验证(OTP)。
主要能力:GET /number_lookup/{phone_number} 查询号码信息,返回 caller_name、carrier、country_code、fraud、national_format、phone_number、portability、record_type。验证方面可发起 SMS(POST /verifications/sms)、语音(/verifications/call)、Flash call(/verifications/flashcall)、WhatsApp(/verifications/whatsapp)验证,均需 phone_number 与 verify_profile_id;可按号码或 ID 查询验证状态(GET /verifications/by_phone_number/{phone_number}、GET /verifications/{verification_id}),并按号码或 ID 提交验证码(POST .../actions/verify,需 code 与 verify_profile_id)。还提供 Verify profile 的增删改查(/verify_profiles)及消息模板的查询、创建与更新(/verify_profiles/templates)。
使用方式:curl 已预装于 macOS、Linux、Windows 10+。设置环境变量 export TELNYX_API_KEY="YOUR_API_KEY_HERE",请求头使用 Authorization: Bearer $TELNYX_API_KEY。号码必须为 E.164 格式(如 +13125550001),带 + 和国家码,不含空格、横线或括号。列表接口分页使用 page[number] 与 page[size],并检查返回中的 meta.total_pages。
限制与错误处理:401 表示 API Key 无效,403 权限不足,404 资源不存在,422 为校验错误(检查字段格式),429 为限流(建议延迟重试)。资料未提供各接口的计费、价格、速率配额与具体平台覆盖信息。