Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create messaging service for subaccount using main account credentials. #694

Open
grimmdude opened this issue Sep 8, 2021 · 1 comment
Labels
type: docs update documentation change not affecting the code

Comments

@grimmdude
Copy link

grimmdude commented Sep 8, 2021

Issue Summary

Creating a new messaging service for a subaccount creates the service in the main account when using main account credentials.

Steps to Reproduce

  1. Instantiate new Client using main account credentials and passing subaccount sid as third argument.
  2. Create messaging service.
  3. New messaging service has been created under the main account.

Code Snippet

use Twilio\Rest\Client;
$twilio = new Client(MAIN_ACCOUNT_SID, MAIN_ACCOUNT_TOKEN, SUBACCOUNT_SID);
$messagingService = $twilio->messaging->v1->services->create('New Messaging Service');

// Messaging service account SID reflects main account instead of subaccount.
$messageService->accountSid === MAIN_ACCOUNT_SID

Technical details:

  • twilio-php version: 6.27
  • php version: 8.0.0
@shwetha-manvinkurke
Copy link
Contributor

@grimmdude The SUBACCOUNT_SID is only used for the v2010 APIs and in order to create the service for your subaccount, you would need to initialize the client with the subaccount accountsid/authtoken.

Internal reference for doc update

@shwetha-manvinkurke shwetha-manvinkurke added the type: docs update documentation change not affecting the code label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs update documentation change not affecting the code
Projects
None yet
Development

No branches or pull requests

2 participants