In this folder, create a new file named SMSRequest.go and add the following to it. To do this, in the application’s top-level folder, create a new folder named model. It will also be passed to the helper module responsible for making the relevant Twilio requests. This struct will be used to marshal and validate POST requests to the endpoint responsible for sending bulk SMS. Build the backend Prepare the request modelįirst, create a struct named SMSRequest. With the Messaging Service created, copy the Messaging Service SID and paste it into. Finally, in Step 5, again, leave the options as they are, click Complete Messaging Service Setup, and click View my new Messaging Service in the modal dialogue that appears. In Step 4, leave the options as they are and click Step 4: Add compliance info. SMS-capable phone numbers are indicated by the left of the two icons in the Capabilities column in the screenshot above. Next, check a Sender from the list that has SMS capabilities and click Step 3: Set up integration. There are multiple sender types that you can choose from, but for the purposes of this tutorial, leave the Sender Type dropdown set to "Phone Number" and click Continue. Then, in Step 2, click Add Senders to start adding senders to the service. In Step 1, enter a name for the service in the "Messaging Service friendly name" field, then click "Create Messaging Service". To do that, in the Twilio Console, under Explore Products > Messaging > Services click Create Messaging Service. The next thing to do is to create a new Messaging Service and retrieve its SID. env.local, replace > and > respectively, with the copied details Copy the details from the " Account Info" panel.The next thing you need to do is to retrieve your Twilio Auth Token and Account SID. Make your Twilio credentials available to the application env.**.local files are ignored by Git as an accepted best practice for storing credentials outside of code to keep them safe.
0 Comments
Leave a Reply. |