2017-10-12 18 views
0

の発信、発信者IDを更新しようとしていますが、エラーを次のように実行している:Twilio更新発信発信者ID

*** Twilio::REST::RestError Exception: Unable to fetch record: The requested resource /2010-04-01/Accounts/AC...../OutgoingCallerIds/CA......json was not found 

私はTwilioのウェブサイト上のドキュメントを次のようだ:

https://www.twilio.com/docs/api/voice/outgoing-caller-ids#get-outgoing-caller-id-details

@caller_id = @client.account 
       .outgoing_caller_ids('PNe905d7e6b410746a0fb08c57e5a186f3') 
       .fetch 

.outgoing_caller_idsに渡す文字列は何ですか?

答えて

0

ここではTwilioの開発者エバンジェリストです。

Outgoing caller IDsは、アカウントから電話をかけているときに発信者番号として使用できる確認済みの番号です。

私は次のコードでの発信、発信者IDを取得することができました:

sid = client.outgoing_caller_ids.list.first.sid 
caller_id = client.outgoing_caller_ids(sid).fetch 

私の推測では、あなたが実際にあなたが数字のことをフェッチして更新するために使用できるリソースであるIncoming Phone Numbers resource、探しているということですあなたはTwilioプラットフォームで購入しました。

次のような多数のSIDでいることを呼び出すことができます。

client.incoming_phone_numbers(sid).fetch 

ことができますなら、私に教えてください。

+0

が動作します、ありがとうございます。サブアカウントの発信発信者IDを作成/更新する方法も知っていますか? – JohnSmith

+0

サブアカウントの処理を行いたい場合は、アカウントオブジェクトを取得してからアクションを実行することができます。 'account = client.accounts(account_sid).fetch; account.validation_requests.create(電話番号:電話番号) '。 – philnash

+0

サブアカウント用のメッセージングサービスを作成するには、 '@client = Twilio :: REST :: Client.new(account_sid、auth_token) sub_account = @ client.api.accounts.create(friendly_name:friendly_name) service = sub_account.messaging.v1.services.create(friendly_name: "#{friendly_name}") ' – JohnSmith

関連する問題