{"id":8821,"date":"2018-03-19T16:42:36","date_gmt":"2018-03-19T05:42:36","guid":{"rendered":"https:\/\/developers.messagemedia.com\/?p=252"},"modified":"2018-03-19T16:42:36","modified_gmt":"2018-03-19T05:42:36","slug":"how-to-send-an-sms-using-google-home","status":"publish","type":"blog","link":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/","title":{"rendered":"How to send an SMS using Google Home"},"content":{"rendered":"<figure class=\"reader-cover-image--grid relative\">\n<div class=\"reader-cover-image--wrapper\"><\/div>\n<\/figure>\n<p>I recently purchased a Google Home Mini. Naturally working at MessageMedia one of my first requests to Google was &#8220;OK Google!!! Send an SMS&#8221; to which I was a bit disappointed, however it presented an opportunity. Over the next few days, I wanted to see if I could build a simple Google Home Action (Google Home app) that could send an SMS using the MessageMedia API (<a href=\"https:\/\/developers.messagemedia.com\/code\/api-documentation\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/developers.messagemedia.com\/code\/api-documentation\/<\/a>). I was quite surprised how easy the whole process was except for the not so intuitive UI flow of Dialogflow, which is the online dev tool.<\/p>\n<p>I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note &#8211; I am not a nodejs developer so please feel free to take the code and work your magic.<\/p>\n<h3>Prerequisites:<\/h3>\n<p>1.\u00a0\u00a0\u00a0A Google account. If you have Gmail you have a Google account.<\/p>\n<p>2.\u00a0\u00a0\u00a0A MessageMedia account username and password. If you go to\u00a0<a href=\"https:\/\/messagemedia.com.au\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/messagemedia.com.au\/<\/a>\u00a0and click on the \u201cTry It Free\u201d link you will receive credentials that will allow you to send 5 free SMS. If you call up you can get the trial limit extended.<\/p>\n<p>3.\u00a0\u00a0\u00a0Unfortunately for the Google Action to use Firebase Google Cloud functions and send requests to a 3rd party API like MessageMedia you need to pay. Firebase is Google\u2019s equivalent of AWS Lambda. There are 2 pricing plans: 1)USD $25 a month per project or 2) Pay as You Go plan. I will show you how to do this because it was not quite as clear.<\/p>\n<p>4.\u00a0\u00a0\u00a0Helps if you have a Google device like a Google Home or Google Home Mini but it is not necessary. You have to be signed into the device with the same Google Account you will be developing with. Dialogflow, which is a online dev tool I use has a handy Google Assistant test tool. You can type in the conversation or if you have a microphone you can speak with the test tool.<\/p>\n<h3>STEP 1: Base 64 encode username and password<\/h3>\n<p>For security and authentication purposes you will need to base 64 encode the username and password so it can be used in the code in STEP 3. To do this go to a page like\u00a0<a href=\"https:\/\/www.base64decode.org\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/www.base64decode.org\/<\/a>\u00a0and you will be able to encode the username and password separated by a colon. You will need the encoded value in STEP 3.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\" data-imgsrc=\"https:\/\/media-exp1.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAAwJAAAAJDI0ODQ4ZTE2LWU2Y2MtNDhmMS05YTRhLWRiYmM1NmI4ZWNjMw.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-292\" src=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2020\/08\/1.jpg\" alt=\"\" width=\"712\" height=\"584\" \/><\/div>\n<h3>STEP 2: Create an Action on Google Project<\/h3>\n<p>I created the Google Action on the Google Dialogflow (previously known as API.AI) online console. This is an easy to use web console that allows you to create human interactions with Google devices. It also has a build in NLU (Natural Language Understanding), which makes a developer\u2019s life a whole lot easier.<\/p>\n<p>The following link is a get started article that I read beforehand and highly recommend &#8211;\u00a0<a href=\"https:\/\/developers.google.com\/actions\/dialogflow\/first-app\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/developers.google.com\/actions\/dialogflow\/first-app<\/a><\/p>\n<p>Navigate to\u00a0<a href=\"https:\/\/console.actions.google.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/console.actions.google.com\/<\/a>.\u00a0 To create a project, click the \u201cAdd\/Import Project\u201d button. Give it a name, something like &#8220;MM-SMS&#8221;. Once the project is created you may need to click on the \u201cAdd Actions \u201d button. This will give you a few different options to create your custom app. Select the &#8220;Build&#8221; link under Dialogflow. Then click on \u201cCreate Action on Dialogflow\u201d. Give the Action a name like &#8220;MM-SMS&#8221; and click &#8220;Create&#8221;.<\/p>\n<h3>STEP 3: Create a Fulfillment<\/h3>\n<p>Click on &#8220;Fulfilment&#8221; and enable the Inline Editor as the function is quite simple. Now paste in the content from the index.js in the following GitHub link &#8211;\u00a0<a href=\"https:\/\/github.com\/gdd1984\/MMGoogleAction\/blob\/master\/index.js\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/github.com\/gdd1984\/MMGoogleAction\/blob\/master\/index.js<\/a>. Make sure to use the encoded value in STEP 1 and replace the text that says \u201cREPLACE-WITH-BASE64-ENCODED-USERNAME-PASSWORD\u201d and click \u201cDeploy\u201d.<\/p>\n<p>Nodejs Code:<\/p>\n<pre><span class=\"hljs-meta\">'use strict'<\/span>;\n<span class=\"hljs-keyword\">var<\/span> https = <span class=\"hljs-built_in\">require<\/span>(<span class=\"hljs-string\">'https'<\/span>);\n\nprocess.env.DEBUG = <span class=\"hljs-string\">'actions-on-google:*'<\/span>;\n<span class=\"hljs-keyword\">const<\/span> App = <span class=\"hljs-built_in\">require<\/span>(<span class=\"hljs-string\">'actions-on-google'<\/span>).DialogflowApp;\n<span class=\"hljs-keyword\">const<\/span> functions = <span class=\"hljs-built_in\">require<\/span>(<span class=\"hljs-string\">'firebase-functions'<\/span>);\n\n\n<span class=\"hljs-comment\">\/\/ a. the action name from the make_name Dialogflow intent<\/span>\n<span class=\"hljs-keyword\">const<\/span> SMS_ACTION = <span class=\"hljs-string\">'send_sms'<\/span>;\n<span class=\"hljs-comment\">\/\/ b. the parameters that are parsed from the make_name intent<\/span>\n<span class=\"hljs-keyword\">const<\/span> PHONE_NUMBER_ARGUMENT = <span class=\"hljs-string\">'phone-number'<\/span>;\n<span class=\"hljs-keyword\">const<\/span> SMS_TEXT_ARGUMENT = <span class=\"hljs-string\">'sms-text'<\/span>;\n\n<span class=\"hljs-comment\">\/\/-----------------------------------------<\/span>\n\nexports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) =&gt; {\n\u00a0 \u00a0 <span class=\"hljs-keyword\">const<\/span> app = <span class=\"hljs-keyword\">new<\/span> App({request, response});\n\u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">'Request headers: '<\/span> + <span class=\"hljs-built_in\">JSON<\/span>.stringify(request.headers));<\/pre>\n<pre>\u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">'Request body: '<\/span> + <span class=\"hljs-built_in\">JSON<\/span>.stringify(request.body));\n\n\u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ c. The function that send SMS using MM Rest API<\/span>\n\u00a0 \u00a0 <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">dialogflowFirebaseFulfillment<\/span> (<span class=\"hljs-params\">app<\/span>) <\/span>{\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">let<\/span> mobileNumber = app.getArgument(PHONE_NUMBER_ARGUMENT);\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">let<\/span> smsText = app.getArgument(SMS_TEXT_ARGUMENT);\n\u00a0\u00a0 \u00a0 \u00a0 \u00a0\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">if<\/span>(mobileNumber.charAt(<span class=\"hljs-number\">0<\/span>) == <span class=\"hljs-string\">\"0\"<\/span> &amp;&amp; mobileNumber.charAt(<span class=\"hljs-number\">1<\/span>) == <span class=\"hljs-string\">\"4\"<\/span>)\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 mobileNumber = mobileNumber.replace(mobileNumber.charAt(<span class=\"hljs-number\">0<\/span>), <span class=\"hljs-string\">\"61\"<\/span>);\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0\u00a0 \u00a0 \u00a0 \u00a0\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">\"DEBUG sms-text\"<\/span>, smsText);\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">\"DEBUG mobileNumber\"<\/span>, mobileNumber);\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/**\n\u00a0 \u00a0 \u00a0 \u00a0 * HOW TO Make an HTTP Call - POST\n\u00a0 \u00a0 \u00a0 \u00a0 *\/<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ do a POST request\n<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ create the JSON object<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">var<\/span> jsonObject = <span class=\"hljs-built_in\">JSON<\/span>.stringify({\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">\"messages\"<\/span> : [\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">\"content\"<\/span>: smsText,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">\"destination_number\"<\/span>: <span class=\"hljs-string\">\"+\"<\/span> + mobileNumber,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">\"format\"<\/span>: <span class=\"hljs-string\">\"SMS\"<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ]\n\u00a0 \u00a0 \u00a0 \u00a0 });\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">\"DEBUG request: \"<\/span>, jsonObject);\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ prepare the header<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">var<\/span> postheaders = {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">'Content-Type'<\/span> : <span class=\"hljs-string\">'application\/json'<\/span>,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-string\">'Authorization'<\/span> : <span class=\"hljs-string\">'Basic REPLACE-WITH-BASE64-ENCODED-USERNAME-PASSWORD'<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 };\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ the post options<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">var<\/span> optionspost = {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 host : <span class=\"hljs-string\">'api.messagemedia.com'<\/span>,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 port : <span class=\"hljs-number\">443<\/span>,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 path : <span class=\"hljs-string\">'\/v1\/messages'<\/span>,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 method : <span class=\"hljs-string\">'POST'<\/span>,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 headers : postheaders\n\u00a0 \u00a0 \u00a0 \u00a0 };\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(<span class=\"hljs-string\">'Options prepared:'<\/span>);\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(optionspost);\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(<span class=\"hljs-string\">'Do the POST call'<\/span>);\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ do the POST call<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">var<\/span> reqPost = https.request(optionspost, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\">res<\/span>) <\/span>{\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.log(<span class=\"hljs-string\">\"statusCode: \"<\/span>, res.statusCode);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ uncomment it for header details<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ console.log(\"headers: \", res.headers);<\/span>\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 res.on(<span class=\"hljs-string\">'data'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\">d<\/span>) <\/span>{\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(<span class=\"hljs-string\">'POST result:\\n'<\/span>);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(d);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.info(<span class=\"hljs-string\">'\\n\\nPOST completed'<\/span>);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });\n\u00a0 \u00a0 \u00a0 \u00a0 });\n\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ write the json data<\/span>\n\u00a0 \u00a0 \u00a0 \u00a0 reqPost.write(jsonObject);\n\u00a0 \u00a0 \u00a0 \u00a0 reqPost.end();\n\u00a0 \u00a0 \u00a0 \u00a0 reqPost.on(<span class=\"hljs-string\">'error'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\">e<\/span>) <\/span>{\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-built_in\">console<\/span>.error(e);\n\u00a0 \u00a0 \u00a0 \u00a0 });\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/\/-----------------------------------------<\/span>\n\u00a0\u00a0 \u00a0\n\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-keyword\">var<\/span> mobileSplit = mobileNumber.split(<span class=\"hljs-string\">\"\"<\/span>);\n\u00a0 \u00a0 \u00a0 \u00a0 app.tell(<span class=\"hljs-string\">'Have sent the SMS to '<\/span> + mobileSplit + <span class=\"hljs-string\">'! For more info on please go to messagemedia.com.au .'<\/span>);\n\n\u00a0 \u00a0 }\n\u00a0 \u00a0 <span class=\"hljs-comment\">\/\/ d. build an action map, which maps intent names to functions<\/span>\n\u00a0 \u00a0 <span class=\"hljs-keyword\">let<\/span> actionMap = <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-built_in\">Map<\/span>();\n\u00a0 \u00a0 actionMap.set(SMS_ACTION, dialogflowFirebaseFulfillment);\n\n\n\u00a0 \u00a0 app.handleRequest(actionMap);\n});\n<\/pre>\n<p>You should end up with something like the following:<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-bleed\" data-imgsrc=\"https:\/\/media-exp1.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAA0LAAAAJGJjZDUwZDk5LThlODMtNDRlNC05NGIyLThjN2FiNGI1Yzk4MQ.jpg\"><img decoding=\"async\" src=\"https:\/\/:0\/\" data-li-src=\"https:\/\/media.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAA0LAAAAJGJjZDUwZDk5LThlODMtNDRlNC05NGIyLThjN2FiNGI1Yzk4MQ.jpg\" \/><img decoding=\"async\" class=\"alignnone wp-image-294\" src=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2020\/08\/2.jpg\" alt=\"\" width=\"737\" height=\"471\" \/><\/div>\n<p>&nbsp;<\/p>\n<p>The code at a high level just takes the phone number and SMS content from a JSON object that gets passed into the Fulfillment function. Then it uses the MessageMedia REST API to do a https post to actually send the SMS. Note, the country code is mandatory.<\/p>\n<h3>STEP 4: Pay for Firebase<\/h3>\n<p>Sorry all, this is where Google Actions start taking your money for accessing 3rd party API\u2019s. Unfortunately, if you do not pay you will not be able to send the HTTP POST request to MessageMedia.<\/p>\n<p>Word of note, if you do not pay and follow on with the next steps the application will still work to the point where it tries to send the HTTP POST request but then fails with a timeout. It never really says that you need to pay and the location you have to pay is a bit tricky at first to navigate to.<\/p>\n<p>If you are in the Fulfillment screen click on the little bottom link that says \u201cView execution logs in the Firebase console\u201d and then it will open the Firebase console. On the bottom left you will see where you can upgrade the subscription. Make sure you select either the Flame or Blaze subscriptions.<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-full-width\" data-imgsrc=\"https:\/\/media-exp1.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAAoZAAAAJGI0OWNlZmRkLWJkN2YtNDBjZC04OGZkLTJhMGQxNDFlYzRiNg.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-295\" src=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2020\/08\/3-scaled-1.jpg\" alt=\"\" width=\"731\" height=\"465\" \/><\/div>\n<h3>STEP 5: Edit the Default Welcome Intent<\/h3>\n<p>Intent defines an interaction with the user. Every action has a default intent.<\/p>\n<p>Navigate to &#8220;Intents in the Dialogflow&#8221; console. Click on \u201cDefault Welcome Intent\u201d. Delete all the default responses and fill in an appropriate default text response that the user will hear after the first time the user first asks the app to open. Then click \u201cSave\u201d.<\/p>\n<p>You should end up with similar to the below:<\/p>\n<div class=\"slate-resizable-image-embed slate-image-embed__resize-bleed\" data-imgsrc=\"https:\/\/media-exp1.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAAwVAAAAJDFjOGQ2YWUyLTgxOTktNGY2NC04MTAxLTE4ZGIwYmM3ZTA0OA.jpg\"><img decoding=\"async\" src=\"https:\/\/:0\/\" data-li-src=\"https:\/\/media.licdn.com\/mpr\/mpr\/AAIAAwDGAAAAAQAAAAAAAAwVAAAAJDFjOGQ2YWUyLTgxOTktNGY2NC04MTAxLTE4ZGIwYmM3ZTA0OA.jpg\" \/><img decoding=\"async\" class=\"alignnone wp-image-296\" src=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2020\/08\/4.jpg\" alt=\"\" width=\"740\" height=\"512\" \/><\/div>\n<h3>STEP 6: Create the send_sms Intent<\/h3>\n<p>This is the Intent with the bulk of the interaction with the user. Click Intents and \u201cCreate Intent\u201d.<\/p>\n<p>There is a lot of detail to fill in on this page. The below image should assist you with filling in the details. The following sections are worth noting:<\/p>\n<p>The &#8220;User says&#8221; section is where you can fill in a few different ways of how you think the user will interact with the question posed in the Default Welcome Intent. The more differences you add in there, the more accurate the NLU gets. Make sure you are selecting \u201c@sys.number-sequence\u201d as the entity as the user will be trying to voice out a phone number. Just a word of caution, other entities have trouble picking up long numbers like this.<\/p>\n<p>The last action is to retrieve the SMS content. Make sure the entity here is \u201c@sys.any\u201d as this will allow for all the content to be sent to the webhook for delivery. Also, both default prompts should be filled in, as these will be used if the content is not recognised to repeat the question.<\/p>\n<p>Next fill in the Actions section with default prompts and make sure you check the Fulfillment, \u201cuse webhooks\u201d and the Google Assistant \u201cend conversation\u201d checkboxes. Make sure to save the intent.<\/p>\n<h3>STEP 7: Test the Action<\/h3>\n<p>Now it starts getting fun. Navigate to Integrations &gt;&gt; Google Assistant &gt;&gt; Select send_sms in the Additional triggering intents section &gt;&gt; click TEST and then the subsequent VIEW button that appears.<\/p>\n<p>Testing of the app can now occur. You can either type in the interactions or use your computer\u2019s microphone.<\/p>\n<h3>STEP 8: Test on Device (optional but most rewarding!)<\/h3>\n<p>As long as you have completed all your Google Actions development in the same account as you used to set up your Google device, you can now test. In my case, I was using a Google Home Mini and all I had to say was \u201cOk Google talk to test app\u201d and off I went.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Quick thanks to\u00a0<a href=\"https:\/\/console.actions.google.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Nicholas Dragon\u00a0<\/a>for helping me with this project. Hope this helps to demonstrate how easy it is to use the MessageMedia SMS API and to get your very own Google Action working. Happy tinkering.<\/p>\n","protected":false},"author":0,"featured_media":8964,"menu_order":237,"template":"page-blog-v2.php","meta":{"_acf_changed":false,"popular":false,"coming_soon":false,"link":"","footnotes":""},"blog_category":[37],"class_list":["post-8821","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog_category-developers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to send an SMS using Google Home - Sinch MessageMedia Australia<\/title>\n<meta name=\"description\" content=\"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic. Australia\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to send an SMS using Google Home - Sinch MessageMedia\" \/>\n<meta property=\"og:description\" content=\"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/\" \/>\n<meta property=\"og:site_name\" content=\"Sinch MessageMedia\" \/>\n<meta property=\"og:image\" content=\"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/03\/How-to-send-an-SMS-using-Google-Home.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"325\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/\",\"name\":\"How to send an SMS using Google Home - Sinch MessageMedia\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/How-to-send-an-SMS-using-Google-Home.jpg\",\"datePublished\":\"2018-03-19T05:42:36+00:00\",\"description\":\"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/#breadcrumb\"},\"inLanguage\":\"en-AU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-AU\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/#primaryimage\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/How-to-send-an-SMS-using-Google-Home.jpg\",\"contentUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/How-to-send-an-SMS-using-Google-Home.jpg\",\"width\":1024,\"height\":325,\"caption\":\"How to send an SMS using Google Home\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/blog\\\/how-to-send-an-sms-using-google-home\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/messagemedia.com\\\/us\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to send an SMS using Google Home\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#website\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/\",\"name\":\"Sinch MessageMedia\",\"description\":\"Business SMS &amp; Messaging Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-AU\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#organization\",\"name\":\"Sinch MessageMedia\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-AU\",\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-mm-sinch.svg\",\"contentUrl\":\"https:\\\/\\\/messagemedia.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-mm-sinch.svg\",\"width\":1,\"height\":1,\"caption\":\"Sinch MessageMedia\"},\"image\":{\"@id\":\"https:\\\/\\\/messagemedia.com\\\/au\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to send an SMS using Google Home - Sinch MessageMedia Australia","description":"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic. Australia","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/","og_locale":"en_US","og_type":"article","og_title":"How to send an SMS using Google Home - Sinch MessageMedia","og_description":"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic.","og_url":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/","og_site_name":"Sinch MessageMedia","og_image":[{"width":1024,"height":325,"url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/03\/How-to-send-an-SMS-using-Google-Home.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/","url":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/","name":"How to send an SMS using Google Home - Sinch MessageMedia","isPartOf":{"@id":"https:\/\/messagemedia.com\/au\/#website"},"primaryImageOfPage":{"@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/#primaryimage"},"image":{"@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/#primaryimage"},"thumbnailUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/03\/How-to-send-an-SMS-using-Google-Home.jpg","datePublished":"2018-03-19T05:42:36+00:00","description":"I\u2019ll run you through some high-level steps I had to go through and the nodejs code I used is on GitHub. Note \u2013 I am not a nodejs developer so please feel free to take the code and work your magic.","breadcrumb":{"@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/#breadcrumb"},"inLanguage":"en-AU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/"]}]},{"@type":"ImageObject","inLanguage":"en-AU","@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/#primaryimage","url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/03\/How-to-send-an-SMS-using-Google-Home.jpg","contentUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2018\/03\/How-to-send-an-SMS-using-Google-Home.jpg","width":1024,"height":325,"caption":"How to send an SMS using Google Home"},{"@type":"BreadcrumbList","@id":"https:\/\/messagemedia.com\/au\/blog\/how-to-send-an-sms-using-google-home\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/messagemedia.com\/au\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/messagemedia.com\/us\/blog\/"},{"@type":"ListItem","position":3,"name":"How to send an SMS using Google Home"}]},{"@type":"WebSite","@id":"https:\/\/messagemedia.com\/au\/#website","url":"https:\/\/messagemedia.com\/au\/","name":"Sinch MessageMedia","description":"Business SMS &amp; Messaging Platform","publisher":{"@id":"https:\/\/messagemedia.com\/au\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/messagemedia.com\/au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-AU"},{"@type":"Organization","@id":"https:\/\/messagemedia.com\/au\/#organization","name":"Sinch MessageMedia","url":"https:\/\/messagemedia.com\/au\/","logo":{"@type":"ImageObject","inLanguage":"en-AU","@id":"https:\/\/messagemedia.com\/au\/#\/schema\/logo\/image\/","url":"https:\/\/messagemedia.com\/wp-content\/uploads\/2024\/03\/logo-mm-sinch.svg","contentUrl":"https:\/\/messagemedia.com\/wp-content\/uploads\/2024\/03\/logo-mm-sinch.svg","width":1,"height":1,"caption":"Sinch MessageMedia"},"image":{"@id":"https:\/\/messagemedia.com\/au\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/blog\/8821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/types\/blog"}],"version-history":[{"count":0,"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/blog\/8821\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/media\/8964"}],"wp:attachment":[{"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/media?parent=8821"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/messagemedia.com\/au\/wp-json\/wp\/v2\/blog_category?post=8821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}