0

I set up an account with microsoft azure communications and provisioned a phone number. I would like to send SMS messages from my PHP application, but the only code snippets are available for JS, Python, C# and Java.

I set up an endpoint (i.e. https://scotttestingsms.communication.azure.com) and have an application key, but I can't figure out how to authenticate with a bearer token. I find the docs to be relatively opaque on this.

mankowitz
  • 1,864
  • 1
  • 14
  • 32
  • There seems no client library for PHP, so you need to call the Azure communications [REST API](https://learn.microsoft.com/en-us/rest/api/communication/sms/send) to send SMS. You need to register client app with Azure and get credentials, follow instructions [here](https://learn.microsoft.com/en-us/rest/api/azure/) – Anand Sowmithiran Mar 09 '22 at 12:14

1 Answers1

0

There is no SDK for PHP, but you can still use Restful APIs to do that. You can find here Send SMS by using Postman a sample for how to send SMS by using Postman, you can do the same in your PHP code

Ebraheem
  • 603
  • 6
  • 24
  • See https://stackoverflow.com/questions/71439439/azure-rest-api-in-php-giving-given-value-does-not-match-hmac-header-structure/71487393 for how I ultimately solved this. – mankowitz Mar 22 '22 at 21:19