SMS API
世界中の任意の電話番号にSMSを送信。
ベースURL
https://api.tellicai.com/v1エンドポイント
POST
/messages電話番号にSMSメッセージを送信
機能
- ✓ グローバルカバレッジ - 任意の国に送信
- ✓ 高速配信 - 通常10秒以内
- ✓ 配信レポート付き
- ✓ Unicodeと長文メッセージ対応
世界中の任意の電話番号にSMSを送信。
https://api.tellicai.com/v1/messages電話番号にSMSメッセージを送信
SMS APIの一般的なユースケース。
注文更新、配送通知、予定リマインダーを顧客に送信。
プロモーションメッセージ、特別オファー、キャンペーンで顧客を惹きつける。
ログイン確認とアカウントセキュリティのための認証コードを送信。
支払いリマインダー、予定確認、重要なアラート。
アプリにSMS APIを統合するためのコード例。
curl -X POST https://api.tellicai.com/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"message": "Hello!"
}'curl -X POST https://api.tellicai.com/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"message": "Hello!"
}'import TellicAI from '@tellicai/sdk';
const client = new TellicAI('YOUR_API_KEY');
const message = await client.messages.create({
to: '+1234567890',
message: 'Hello from TellicAI!'
});
console.log(message.id);import TellicAI from '@tellicai/sdk';
const client = new TellicAI('YOUR_API_KEY');
const message = await client.messages.create({
to: '+1234567890',
message: 'Hello from TellicAI!'
});
console.log(message.id);import { Injectable } from '@nestjs/common';
import { TellicaiService } from './tellicai.service';
@Injectable()
export class SmsService {
constructor(private tellicai: TellicaiService) {}
async sendSms(to: string, message: string) {
return this.tellicai.messages.create({
to,
message
});
}
}import { Injectable } from '@nestjs/common';
import { TellicaiService } from './tellicai.service';
@Injectable()
export class SmsService {
constructor(private tellicai: TellicaiService) {}
async sendSms(to: string, message: string) {
return this.tellicai.messages.create({
to,
message
});
}
}import { NextResponse } from 'next/server';
import TellicAI from '@tellicai/sdk';
const client = new TellicAI(process.env.TELLICAI_KEY);
export async function POST(request: Request) {
const { to, message } = await request.json();
const result = await client.messages.create({
to,
message
});
return NextResponse.json(result);
}import { NextResponse } from 'next/server';
import TellicAI from '@tellicai/sdk';
const client = new TellicAI(process.env.TELLICAI_KEY);
export async function POST(request: Request) {
const { to, message } = await request.json();
const result = await client.messages.create({
to,
message
});
return NextResponse.json(result);
}package main
import "github.com/tellicai/sdk-go"
func sendSMS(to, message string) {
client := tellicai.NewClient("YOUR_API_KEY")
msg, err := client.Messages.Create(tellicai.MessageParams{
To: to,
Message: message,
})
if err != nil {
panic(err)
}
println(msg.ID)
}package main
import "github.com/tellicai/sdk-go"
func sendSMS(to, message string) {
client := tellicai.NewClient("YOUR_API_KEY")
msg, err := client.Messages.Create(tellicai.MessageParams{
To: to,
Message: message,
})
if err != nil {
panic(err)
}
println(msg.ID)
}<?php
require 'vendor/autoload.php';
$client = new TellicAI('YOUR_API_KEY');
$message = $client->messages->create([
'to' => '+1234567890',
'message' => 'Hello!'
]);
echo $message->id;<?php
require 'vendor/autoload.php';
$client = new TellicAI('YOUR_API_KEY');
$message = $client->messages->create([
'to' => '+1234567890',
'message' => 'Hello!'
]);
echo $message->id;<?php
namespace App\Http\Controllers;
use TellicAI\TellicAI;
class SmsController extends Controller
{
public function send(Request $request)
{
$client = new TellicAI(env('TELLICAI_KEY'));
$message = $client->messages->create([
'to' => $request->to,
'message' => $request->message
]);
return response()->json($message);
}
}<?php
namespace App\Http\Controllers;
use TellicAI\TellicAI;
class SmsController extends Controller
{
public function send(Request $request)
{
$client = new TellicAI(env('TELLICAI_KEY'));
$message = $client->messages->create([
'to' => $request->to,
'message' => $request->message
]);
return response()->json($message);
}
}using Tellicai;
using System;
var client = new TellicAIClient("YOUR_API_KEY");
var message = await client.Messages.CreateAsync(
new MessageParams {
To = "+1234567890",
Message = "Hello!"
}
);
Console.WriteLine(message.Id);using Tellicai;
using System;
var client = new TellicAIClient("YOUR_API_KEY");
var message = await client.Messages.CreateAsync(
new MessageParams {
To = "+1234567890",
Message = "Hello!"
}
);
Console.WriteLine(message.Id);{
"id": "msg_3MqNsjvKd2vJ7eN8dQ2pL9xZ",
"object": "message",
"to": "+1234567890",
"from": "+1987654321",
"message": "Hello from TellicAI!",
"status": "sent",
"created_at": 1710000000
}{
"id": "msg_3MqNsjvKd2vJ7eN8dQ2pL9xZ",
"object": "message",
"to": "+1234567890",
"from": "+1987654321",
"message": "Hello from TellicAI!",
"status": "sent",
"created_at": 1710000000
}認証用のワンタイムパスワード確認。
https://api.tellicai.com/v1/otps電話番号にOTPを送信
/otps/:id/verifyユーザーが入力したOTPコードを確認
OTP APIの一般的なユースケース。
アカウント作成時に電話番号を検証し、有効なユーザー情報を確保。
二要素認証でユーザーログインにセキュリティ層を追加。
検証済み電話番号にOTPを送信して安全なパスワードリセット。
送金やアカウント設定変更などの重要操作を検証。
アプリにOTP APIを統合するためのコード例。
curl -X POST https://api.tellicai.com/v1/otps \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "to=+1234567890" \
-d "length=6"curl -X POST https://api.tellicai.com/v1/otps \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "to=+1234567890" \
-d "length=6"const otp = await client.otps.create({
to: '+1234567890',
length: 6
});
console.log(otp.id);const otp = await client.otps.create({
to: '+1234567890',
length: 6
});
console.log(otp.id);async sendOtp(phone: string) {
return this.tellicai.otps.create({
to: phone,
length: 6
});
}async sendOtp(phone: string) {
return this.tellicai.otps.create({
to: phone,
length: 6
});
}const otp = await client.otps.create({
to: phone,
length: 6
});const otp = await client.otps.create({
to: phone,
length: 6
});otp, err := client.Otps.Create(tellicai.OtpParams{
To: phone,
Length: 6,
})otp, err := client.Otps.Create(tellicai.OtpParams{
To: phone,
Length: 6,
})$otp = $client->otps->create([
'to' => '+1234567890',
'length' => 6
]);$otp = $client->otps->create([
'to' => '+1234567890',
'length' => 6
]);$otp = $client->otps->create([
'to' => $phone,
'length' => 6
]);$otp = $client->otps->create([
'to' => $phone,
'length' => 6
]);var otp = await client.Otps.CreateAsync(
new OtpParams {
To = "+1234567890",
Length = 6
}
);var otp = await client.Otps.CreateAsync(
new OtpParams {
To = "+1234567890",
Length = 6
}
);curl -X POST https://api.tellicai.com/v1/otps/otp_xxx/verify \
-d "code=123456"curl -X POST https://api.tellicai.com/v1/otps/otp_xxx/verify \
-d "code=123456"const result = await client.otps.verify('otp_xxx', {
code: '123456'
});
console.log(result.valid);const result = await client.otps.verify('otp_xxx', {
code: '123456'
});
console.log(result.valid);async verifyOtp(otpId: string, code: string) {
return this.tellicai.otps.verify(otpId, {
code
});
}async verifyOtp(otpId: string, code: string) {
return this.tellicai.otps.verify(otpId, {
code
});
}const result = await client.otps.verify(otpId, {
code
});const result = await client.otps.verify(otpId, {
code
});result, err := client.Otps.Verify(
"otp_xxx",
map[string]string{"code": "123456"}
)result, err := client.Otps.Verify(
"otp_xxx",
map[string]string{"code": "123456"}
)$result = $client->otps->verify('otp_xxx', [
'code' => '123456'
]);$result = $client->otps->verify('otp_xxx', [
'code' => '123456'
]);$result = $client->otps->verify($otpId, [
'code' => $code
]);$result = $client->otps->verify($otpId, [
'code' => $code
]);var result = await client.Otps.VerifyAsync(
"otp_xxx",
new VerifyParams { Code = "123456" }
);var result = await client.Otps.VerifyAsync(
"otp_xxx",
new VerifyParams { Code = "123456" }
);{
"id": "otp_8KpXvL2mN4wQ6tR9yZ3bA5cD",
"object": "otp",
"to": "+1234567890",
"status": "verified",
"valid": true,
"attempts": 1
}{
"id": "otp_8KpXvL2mN4wQ6tR9yZ3bA5cD",
"object": "otp",
"to": "+1234567890",
"status": "verified",
"valid": true,
"attempts": 1
}