I am using the Twilio PHP helper library.
I have several subaccount credentials stored in the database. Each subaccount usually has several outgoing caller ids associated with it.
I use the credentials for each subaccount to get the outgoingCallerIds.
From the data returned, I take the subaccount SID (AC) and the number SID (PN).
I follow the documentation and am receiving errors on each attempt to update master with the numbers from the subaccounts.
Caught exception: [HTTP 404] Unable to update record: The requested resource /2010-04-01/Accounts/ACxxxxxxxxxxxxxx/IncomingPhoneNumbers/PNxxxxxxxx.json was not found
I have checked the account sids and number sids and they are correct.
Any idea where I'm going wrong here?
Here is my Try that happens in a foreach which credentials for every subaccount.
try
{
$client = new Client($sid, $token); //subaccount sid and token from not shown foreach
$caller_ids = $client->outgoingCallerIds->read();
foreach ($caller_ids as $caller_id)
{
$phone_number = $caller_id->phoneNumber;
$friendly_name = $caller_id->friendlyName;
$number_sid = $caller_id->sid;
$account_sid = $caller_id->accountSid;
$incoming_phone_number = $master_account->incomingPhoneNumbers("$number_sid")
->update(
array("accountSid" => "$account_sid")
);
}
}