How do I add my Messaging Service SID to a phone number via the Rest API?

This can be done through the UI in the console, but I don't see any support for it in the API.

Currently when creating a provisioning a number I do this:

 $twilio   = self::get_Twilio_Client();

  $incoming_phone_number = $twilio->incomingPhoneNumbers->create( [

   "friendlyName" => $user->first_name . ' ' . $user->last_name,

   "phoneNumber" => "+1" . $phone_number,

   "Voice" => true,

   "SMS"  => true,

   "MMS"  => true,

   'smsApplicationSid'  => config('services.twilio')['app_aid'],

   'voiceApplicationSid' => config('services.twilio')['app_aid'],

   'AddressSid'     => config('services.twilio')['addr_sid'],

  ]);

I'm expecting to be able to add 'MessagingSid' or something to that affect in the options.

I do NOT want to add the phone number to the messaging service itself.

Cheers,

Tagged:

Answers

  • I do NOT want to add the phone number to the messaging service itself.

    You can't add a messaging service SID to a number, numbers get added to a messaging service.

    What are you actually trying to achieve here?

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support