Skip to content

Impossible to create messaging services through AccountInstance resource #661

@rafaeelaudibert

Description

@rafaeelaudibert

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions