Open rafaeelaudibert opened 1 year ago
I'm trying to escalate this through your internal support ID #12597290. 2 weeks without any triage here sounds bad.
Twilio's support directed me to https://www.twilio.com/docs/iam/api/subaccounts#authentication, more specifically
Your main account credentials will allow you to access resources for any of your subaccounts that fall under the v2010 REST API. However, resources on subdomains, such as studio.twilio.com and taskrouter.twilio.com, must be accessed directly using subaccount credentials (API Keys or subaccount SID + subaccount auth token).
There are many ways to determine if a resource lives on its own subdomain or under v2010. One example method is to find the API Reference page for the resource, such as the Workspace resource. Observe the returned url value in the example payloads: if the URL begins with https://SOME-SUBDOMAIN.twilio.com, then you must access that resource using subaccount-specific credentials. If you do the same for some other resource, such as the Messaging resource, and see that uri begins with /2010-04-01, then it can be safely accessed using either your main account or subaccount credentials.
I'm still checking to see if there's the option to change this in the future to make the experience more seamless.
This was their response:
I confirmed with our Product Team, and there are no plans in the near future to implement this functionality. Using parent resources to do CRUD actions on subaccounts is something we actively suggest against.
I'll keep this issue open for now, but any Twilio rep can close it if you think this should be closed.
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 themessaging
APIThat 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 https://github.com/twilio/twilio-ruby/issues/225.
When trying the workaround on that issue we found the actual issue here:
messaging
is not defined on theAccountInstance
class https://github.com/twilio/twilio-ruby/blob/e6ef5385fa49a866e254bc9efd6ca0971ca213b5/lib/twilio-ruby/rest/api/v2010/account.rb#L679For that reason, this does not work:
messaging
is not the only missing namespace, astrusthub
cannot be found either.Technical details: