-
Notifications
You must be signed in to change notification settings - Fork 471
Open
Description
Issue Summary
We are trying to create messaging services on a subaccount. At first, we tried doing so following what is suggested on the README, by instantiating a client containing the subaccount_sid and then hitting the messaging API
client = Twilio::REST::Client.new(account_sid, auth_token, subaccount_sid)
client.messaging.v1.services.create(friendly_name: "Test Subaccount")That does not work because the gem uses the main account SID instead of the subaccount SID in the request path. That's already been explained on #225.
When trying the workaround on that issue we found the actual issue here: messaging is not defined on the AccountInstance class
| class AccountInstance < InstanceResource |
For that reason, this does not work:
client = Twilio::REST::Client.new(account_sid, auth_token)
account = client.accounts.get(subaccount_sid)
number = account.messaging.v1.services.create(friendly_name: "Test Subaccount") # NoMethodError: undefined method `messaging' for #<Twilio::REST::Api::V2010::AccountInstance:0x00005617df452e30>messaging is not the only missing namespace, as trusthub cannot be found either.
Technical details:
- twilio-ruby version: 6.0.1
- ruby version: 2.6.6
Metadata
Metadata
Assignees
Labels
No labels