我需要上个月使用特定的twilio子帐户。我按照官方文档中的说明尝试了,我在传递主帐户的Sid和Auth Token时得到了回复但是,在传递子帐户凭据时我无法获得任何详细信息。这是我试过的代码。
$sid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$token = "your_auth_token";
$twilio = new Client($sid, $token);
$calls = $twilio->calls
->read(array("startTime" => new \DateTime('2018-1-15')));
foreach ($calls as $record) {
print($record->sid);
}
你可以使用Twilio RecordSource并传递CategoryEnum作为TotalPrice
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$categoryEnum = "total_price"
$client = new Client($sid, $token, $categoryEnum);
在C#中
TwilioClient.Init(SID, AuthToken);
DateTime currentDate = DateTime.Now;
DateTime startDate = new DateTime(currentDate.Year, currentDate.Month, 1);
var twilioPrice = (await RecordResource.ReadAsync(twilioSubAccount.SID,
category: RecordResource.CategoryEnum.Totalprice,
startDate: startDate,
endDate: startDate.AddMonths(1)))
.FirstOrDefault();