メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Functions FAQ

BETA


This Twilio product is currently available as a beta release. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Beta products are not covered by a Twilio SLA.

See this article for more information on beta product support.

なぜ作成したFunctionが「ランタイムアプリケーションタイムアウト」を返すのですか?

There are two possible reasons for why your Function has completed with the error: 'runtime application timed out'.

もっとも一般的な理由はFunctionが5秒間の制限時間を超えて実行を続けた場合です。 Functionインスタンスページの実行ログを確認することで、これを判別できます。 実行後のログの最終行に、Functionの実行に要した時間をミリ秒単位で表示されています。 処理時間が5,000ミリ秒を超えている場合は、FunctionはTwilioによって終了させれたということです。

The other more subtle reason your Function ended with an application timeout is because of an incorrect invocation of callback(). If the callback() method is not being called or is unreachable your Function will continue executing until it reaches the timelimit and ultimately fail. The Function Execution documentation provides extensive details on the functionality and usage of the callback() method. Below are several examples of how to correctly use callback() to complete execution and emit a response.

        
        
        
        
        非同期HTTPリクエストでcallback()を適切に使用する方法の例

        非同期HTTPリクエストで実行を完了する

        非同期HTTPリクエストでcallback()を適切に使用する方法の例

        なぜコードが実行されないのですか?

        The most common reason we have seen that a Function appears not to run is misuse of callback(). If the callback() method is not being called or is unreachable your Function will continue to execute until it reaches the timelimit and ultimately fail. This makes it appear as if your Function is not executing because there is no response emitted. The Function Execution documentation provides extensive details on the functionality and usage of the callback() method. Below are several examples of how to correctly use callback() to complete execution and emit a response.

              
              
              
              
              空のHTTP 200 OKの返し方の例

              シンプルな成功レスポンス

              空のHTTP 200 OKの返し方の例

              Voice TwiMLの組み立て方は?

              Function内臓のTwilio Nodeライブラリーを使用してVoice TwiMLを生成できます。

                    
                    
                    
                    
                    Voice TwiMLレスポンスの組み立て方の例

                    Voice TwiMLを組み立てる

                    Voice TwiMLレスポンスの組み立て方の例

                    Messaging TwiMLの返し方は?

                    Function内臓のTwilio Nodeライブラリーを使用して、MessagingTwiMLを生成できます。

                          
                          
                          
                          
                          Messaging TwiMLの組み立て方法の例

                          Messaging TwiMLを組み立てる

                          Messaging TwiMLの組み立て方法の例

                          JSONの返し方は?

                          Function 実行ドキュメントで触れられているように、オブジェクトを返すだけで行えます。

                                
                                
                                
                                
                                HTTP 200 OKでJSONを返す方法の例

                                JSONの成功レスポンスを返す例

                                HTTP 200 OKでJSONを返す方法の例

                                CORSヘッダーの送信方法は?

                                You can send CORS headers by using the Twilio Response object described in the Function Execution documentation.

                                      
                                      
                                      
                                      
                                      Twilio Responseに複数のヘッダーを設定する例

                                      Responseに複数のHTTPヘッダーを設定する

                                      Twilio Responseに複数のヘッダーを設定する例

                                      FUnctionsやAssetsのREST APIはありますか?

                                      Not yet, currently, Functions and Assets can only be accessed through the Twilio Console. But keep and eye on this space for updates. Please reach out to us via support or our Google Group to express interest in this feature.

                                      Functionをスケジュールにもとづいて実行できますか?

                                      Not today, currently, Functions are event driven and can only be invoked by HTTP.

                                      既存のFunctionsのサンプルはありますか?

                                      Absolutely! In addition to our Programmable SMS and Programmable Voice quickstarts, you can find a variety of templates within our catalogue within the Create Function page.

                                      How many Functions can I create?

                                      During the beta period, we currently have a limit of 50 functions per account.

                                      Rate this page:

                                      ヘルプが必要ですか?

                                      We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.