Ahoy logo

Twilio開発者ハブ

Twilioによりあらゆるコミュニケーションとデジタルエンゲージメントソリューションを構築できるチュートリアル、ベストプラクティス、コードサンプル、ヒント。
 

製品別のリソースはこちら

Twilioを使用した次のプロジェクトへの取り組みをサポートするサンプルコードとステップバイステップガイドをご用意しています。

Messaging API

Messaging APIとConversations APIを使用し、SMS、MMS、WhatsApp、Facebook Messengerなどを介してメッセージを送受信できます。

  • C#/.NET、Java、Node.js、PHP、Python、Ruby、Goのヘルパーライブラリに対応するサンプルコードとチュートリアル

  • ユースケースを世界の180か国以上で展開し、不正行為を防止 

  • 99.95%以上の月間APIアップタイム

     

メッセージを作成

// Download the helper library from https://www.twilio.com/docs/node/install
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.messages
      .create({from: '+15017122661', body: 'Hi there', to: '+15558675310'})
      .then(message => console.log(message.sid));
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client


# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

message = client.messages.create(
                              from_='+15017122661',
                              body='Hi there',
                              to='+15558675310'
                          )

print(message.sid)
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


class Program
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = MessageResource.Create(
            from: new Twilio.Types.PhoneNumber("+15017122661"),
            body: "Hi there",
            to: new Twilio.Types.PhoneNumber("+15558675310")
        );

        Console.WriteLine(message.Sid);
    }
}
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Message;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message = Message.creator(
                new com.twilio.type.PhoneNumber("+15558675310"),
                new com.twilio.type.PhoneNumber("+15017122661"),
                "Hi there")
            .create();

        System.out.println(message.getSid());
    }
}
require_once '/path/to/vendor/autoload.php';

use Twilio\\Rest\\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
\$sid = getenv("TWILIO_ACCOUNT_SID");
\$token = getenv("TWILIO_AUTH_TOKEN");
\$twilio = new Client(\$sid, \$token);

\$message = \$twilio->messages
                  ->create("+15558675310", // to
                           ["from" => "+15017122661", "body" => "Hi there"]
                  );

print(\$message->sid);
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client.messages.create(
                             from: '+15017122661',
                             body: 'Hi there',
                             to: '+15558675310'
                           )

puts message.sid
# Install the twilio-cli from https://twil.io/cli

twilio api:core:messages:create \\
    --from +15017122661 \\
    --body "Hi there" \\
    --to +15558675310
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/\$TWILIO_ACCOUNT_SID/Messages.json" \\
--data-urlencode "From=+15017122661" \\
--data-urlencode "Body=Hi there" \\
--data-urlencode "To=+15558675310" \\
-u \$TWILIO_ACCOUNT_SID:\$TWILIO_AUTH_TOKEN
Personalized Twilio console

無料トライアルで構築を始める

無料アカウントにサインアップすると、少額ですがトライアル用の残高が与えられますので、Twilio APIを試していただけます。

コミュニティ


Twilioコミュニティへの参加はこちら

Twilio開発者コミュニティに問い合わせ、Twilioで構築中のものを確認したり、プロジェクトのサポートを受けてください。

Picture of Neeraj Chaudhary from Symbl.ai

Neeraj Chaudhary氏、Symbol.ai

アプリ開発が実際のユースケースと食い違うことが多すぎます。Symbl.aiのセールスソリューションエンジニアリングリードであるNeeraj Chaudhary氏は、それを解決したいと考えています。プラットフォームのヒントになったもの、TwilioのAPIやTwilio Flexなどの製品をどのように活用しているか、それが対話型インテリジェンスの将来で意味するものをご覧ください。

トレーニング


スキルのレベルアップ

レベルアップ: TwilioとGOの大規模な統合

 

Twilio Goヘルパーライブラリは、新しい機能を備え、最新の言語機能を活用しています。Goを使用してTwilioとの統合を拡張する方法を学びます。 

 

トレーニングを開始する 

レベルアップ: スムーズな認証

 

ユーザーの認証はストレスを増やすか、セキュリティを高めるかの二者択一だという考え方を克服する新しいテクノロジーについて学びます。

 

トレーニングを開始する 

Superclassオンデマンド

 

Twilioの開発者に好評のコーディング主体のワークショップが、録画済みのオンデマンドビデオシリーズとしてご覧いただけるようになりました。今すぐサインアップして、オンデマンドSuperclassイベントに登録してください!

 

今すぐ見る

役立つリンク


Twilioのリソース

  • ドキュメント

    APIリファレンスドキュメント、各言語のSDK、サンプルアプリを見るにはこちらから。

  • Twilio CodeExchange logo
    CodeExchange

    組み込みチュートリアルにより、一般的なユースケースから始められます。

  • A newspaper article
    ブログ

    SegmentとTwilio Programmable Messagingを使用し、パーソナライズされたSMSキャンペーンを顧客に送信する方法をご紹介します。

  • Twilio CLI logo
    CLI

    Twilio CLIを使用すると、ご使用の端末やコマンドプロンプトからTwilioのリソースを管理できます。

  • A document with a checkmark
    APIステータス

    Twilio APIの現在のステータスを確認できます。

  • Spreadsheet document
    変更ログ

    Twilioの製品とサービスの最新情報を確認するには、登録してください。

  • Document Lined
    Twilio Collective on Stack Overflow

    幅広いTwilioコミュニティに質問し、回答を得ることができます。

  • Twilio Support Center logo
    サポート

    ヘルプセンターの記事を参照して、よくある質問の回答を確認してください。

始めましょう


構築を始める

料金は従量制で、サブスクリプションはありません。規模の拡大に合わせて、ボリュームの追加や確約利用割引をご用意しています。