Skip to content

Twilio SDK indicates MMS and SMS as false, even though the API confirms them as true for both #783

@axelthat

Description

@axelthat

Issue Summary

I wanted to get the list of numbers for area code 215. However, the SDK returns MMS and SMS capabilities as false even though the API returns them as true.

Steps to Reproduce

Returns MMS and SMS capabilities as false.

$twilio = new \Twilio\Rest\Client(config('twilio.sid'), config('twilio.auth_token'));
$availablePhoneNumbers = $twilio
    ->availablePhoneNumbers('US')
    ->local->read(['areaCode' => 215], 20);

Returns MMS and SMS capabilities as true.

curl "https://api.twilio.com/2010-04-01/Accounts/XXX/AvailablePhoneNumbers/US/Local.json?AreaCode=215&PageSize=20"

$this->mms = Values::array_get($capabilities, 'mms', "false");
$this->sms = Values::array_get($capabilities, 'sms', "false");

If we take a look at API, the key "MMS" and "SMS" are uppercase, so I believe the above two lines should follow the same case?

{
   "address_requirements" : "none",
   "beta" : false,
   "capabilities" : {
      "MMS" : true,
      "SMS" : true,
      "voice" : true
   },
   ...
}

Technical details:

  • twilio-php version: 7.8.0
  • php version: 8.2.8

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