Home
User Guide: Setup SMS Reminders
Contents
1. ch CURLOPT POSTFIELDS request Set the POST Variables 7 SLespolse ctrl exec Sch Ma smscentral Page 6 support smscentral com au 1300 971 093 Execute the Request curleclease scn Close the CURL handle if Sresponse 0 The message was sent successfully You can end here or store in your database etc a else ies An error message was returned You can log this or email it or re try the cURL request etc Check out the API Reference for a list of possible error codes and reasons 2 E gt The above PHP example uses the cURL library CURL is available with PHP since PHP Version 4 0 2 To learn about cURL check out the PHP Docs at http ohp net manual en book curl ohp So the code above will get you going to send the actual message You should pay attention to the response to the HTTP POST as it will let you know whether your message will be delivered or if any error has occurred i e an invalid number out of credit etc please check the API Reference for a list of possible error codes and reasons Ma smscentral Page 7 support smscentral com au 1300 971 093 NEAT LEMS GET REPLIES There are two ways to get replies You can have them sent to your server in real time or you can check for new replies when you re ready If you d like to receive replies in real time you can set this up easily by logging in to your SMS Central account and setting u
2. curl setopt ch CURLOPT_POST true Set POST method curl setopt ch CURLOPT_POSTFIELDS request Set the POST Variables response curl_exec ch Execute the Request curl_close ch Close the CURL handle if response 2z R Ma smscentral Page 24 support smscentral com au 1300 971 093 The message was sent successfully You can end here or store in your database etc a else Vis An error message was returned You can log this or email it or re try the CURL request etc Check out the API Reference for a list of possible error codes and reasons we CS The above PHP example uses the cURL library CURL is available with PHP since PHP Version 4 0 2 To learn about cURL check out the PHP Docs at http php net manual en book curl php So the code above will get you going to send the actual message You should pay attention to the response to the HTTP POST as it will let you know whether your message will be delivered or if any error has occured i e an invalid number out of credit etc please check the API Reference for a list of possible error codes and reasons That s really all there is to it You re now set to sent SMS Notifications and Reminders ssmscentral Page 25 support smscentral com au 1300 971 093 API Support EMAIL If you have any questions or want to learn more get in touch with our Tech Team You can address your email to Ig
3. how you would implement this So what did you decide wantto send Reminder amp Notification Messages and receive Replies wantto send Reminder amp Notification Messages without Replies Ma smscentral Page 3 support smscentral com au 1300 971 093 want to send Reminder amp Notification Messages amp receive replies FIRST LETS SEND THE MESSAGE The first thing you ll need to do is send the message via a HTTP POST to the SMS Central API URL Since this is just one single message here are the required parameters as described by the API Reference that will apply USERNAME This is your SMS Central username PASSWORD This is your SMS Central password ACTION As you are sending a message the value for this parameter will always be send ORIGINATOR This is the number you re sending the message from If you have a dedicated number then you would have that number as the value otherwise you would use the string value shared to send the message from a pool of shared numbers provided by SMS Central RECIPIENT This is the number in international format i e 61420314421 for an Australian mobile that you want to send the message to REFERENCE You can supply a unique must be unique reference value which is relevant to you and you ll get the same reference value with any reply so that you can match the reply to the original sent message MESSAGE_TEXT You ve probably guessed t
4. s parameters ORIGINATOR DrNick JES this is the mobile number of the person you want to send this message to We recommend using international format without the sign Here s an example Australian mobile replace this with the actual mobile you want to send to ey parameters RECIPIENT 61420314421 JES The reference parameter this should always be unique string This is the value that will let you match replies with the original outbound message Here s an example on generating a random value though you may want to use values that are of some significance to you such as the ID of the outbound message in your database etc ZJ parameters REFERENCE rand 0 getrandmax parameters REFERENCE hash md5 parameters REFERENCE i this should always be send for sending a message S parameters MESSAGE_TEXT Hi Homer just a reminder that we have an appointment tomorrow at 1 30pm Ma smscentral Page 23 support smscentral com au 1300 971 093 JEN Now we can send the the HTTP POST to SMS Central with all the required parameters We ll do it with CURL af request foreach parameters as key gt value request key value amp j rtrim request amp ch curl init curl setopt ch CURLOPT_URL url Set the URL curl setopt ch CURLOPT_RETURNTRANSFER 1 Return as a variable
5. send the message from a Name rather than a shared or dedicated number This means the message can appear to come from your own name or company name So instead of having the value shared or an actual number in the ORIGINATOR parameter you can use an alphanumeric name numbers and letters only no Spaces max 11 characters This means your message will appear to come from the name you determine as the ORIGINATOR In this guide we ll provide a PHP code example of sending a message that will appear to come from DrNick Ma smscentral Page 20 support smscentral com au 1300 971 093 LE To SEND THE MESSAGE The first thing you ll need to do is send the message via a HTTP POST to the SMS Central API URL Since this is just one single message here are the required parameters as described by the API Reference that will apply USERNAME This is your SMS Central username PASSWORD This is your SMS Central password ACTION As you are sending a message the value for this parameter will always be send ORIGINATOR You can specify an alphanumeric value such as a name or company name etc containing numbers and letters only up to a maximum of 11 characters Your message will appear to come from this name rather than a number RECIPIENT This is the number in international format i e 61420314421 for an Australian mobile that you want to send the message to REFERENCE You can supply a uni
6. Wa smscentral User Guide Setup SMS Reminders LAST UPDATE JUNE 2014 Contents GENS Fall OVOSVISW ois sscccinsvacasnsscssiiunssecsewassssvsnsennndessnecivessanssuunbsesacotesscosrenstenbetecsbentenens 3 want to send Reminder amp Notification Messages amp receive replies 4 EAEE NEEE AE A A EATE 4 Next lets GE TSTMS co ie scant vigpipeisdesaauoyon an ia naaa E ea a 8 Receive RepieS TREGTIE murusia nyani po ii TA osnd aa EEE E 8 Checking for Replies CONDE IIGIIG sassncacessiisivdecendtanpanieliytednnaniivedianesabsonslvensisiiobddadaciaadhaberteinis 12 want to send Reminder amp Notification Messages without Replies 20 Lers St Atal meS Sag Eere ran E E E eciainaons asa Rocce 21 APT SUD DOI ATT T T 26 AE A E ee eT 26 DSENA AE E EA E E E T 26 Ma smscentral Page 2 support smscentral com au 1300 971 093 General Overview SMS messages are a common and valuable way to send individual notifications and reminder messages such as appointment reminders Sending out reminders amp notification messages via SMS Central s API is easy There s only 1 simple decision to make before you get started Do you want to receive response messages or not If you do then you ll need to be able to receive these messages via the API too This tutorial utilises the SMS Central API please read the API Reference document to help you understand what we re on about in this tutorial Ok let s get started on
7. above code sample you may delete this line the response variable should now contain the response with all the unread messages This will be in XML format check out the next part of this guide to help you through this ay messages new SimpleXMLElement response Ma smscentral Page 17 support smscentral com au 1300 971 093 Let s loop through all the messages received just for fun You can ignore this whole foreach block We ve only added it here to provide an example 47 foreach messages gt message as message i You have the message variable availale You can access each element such as the messagetext with messagetext message gt messagetext oy IS let s just get the message text from the first message directly and output to the screen 47 firstMessageText messages gt message O gt messagetext echo firstMessageText gt Ma smscentral Page 18 support smscentral com au 1300 971 093 Essentially that s all you need in order to check for received messages You re now all set to send reminder amp notifications messages and check for replies on demand Ma smscentral Page 19 support smscentral com au 1300 971 093 want to send Reminder amp Notification Messages without Replies Easy It s exactly the same as sending reminder amp notifications messages where you do want replies except this time you re also able to
8. essage that you sent out if you provided a REFERENCE value for that message we ll send you the same value in this reply this is so that you can match up the messages on your side too MESSAGE_TEXT As you d probably be expecting this parameter will contain a string value of the actual message text that the person replying has sent through Some code Now that you know which parameters to expect let s run through some sample code that you can use to receive SMS messages replies in real time to your own server We are providing a PHP example here below however this can be done with any programming language we ll add more and more code samples with different languages over time or let us know if you need some help Ma smscentral Page 9 support smscentral com au 1300 971 093 lt php username _POST USERNAME password _POST PASSWORD originator _POST ORIGINATOR recipient _POST RECIPIENT reference _POST REFERENCE messagetext _POST MESSAGE_TEXT Always output a 0 for SMS Central This is required so that SMS Central s server knows that you have received the message If you don t output this SMS Central s server will continue trying to send you the message and may result in multiple inbound messages ny echo 0 Check that the username and password values match your actual username and password jor SMS Central t
9. g is in PHP however this can be done with any programming language we ll add more and more code samples with different languages over time or let us know if you need some help lt php The URL for SMS Central s API where your HTTP POST should be sent ay url https my smscentral com au api v3 0 JES X replace the value of this variable with your username x parameters USERNAME your username X replace the value of this variable with your password af parameters PASSWORD your password Ma smscentral Page 13 support smscentral com au 1300 971 093 p this should always be read for reading a message Zi parameters ACTION read Set the ODatestart parameter to the start of yesterday parameters DATESTART date Y m d 00 00 00 strtotime 1 day a Set the Datestart parameter to the end of yesterday E parameters DATEEND date Y m d 23 59 59 strtotime 1 day We are checking for unread messages only ay parameters STATUS UNREAD Now we can send the HTTP POST to SMS Central with all the required parameters We ll do it with CURL we request foreach parameters as key gt value request key value amp Ma smscentral Page 14 support smscentral com au 1300 971 093 rtrim request am
10. gt lt datestamp gt 201 1 12 27 11 10 59 lt datestamp gt lt direction gt MO lt direction gt lt originator gt 61 XxXxxxxxxx lt originator gt lt recipient gt 61 Xxxxxxxxx lt originator gt amessagetext ai Dr Nick its Bart meed to come im jor a cmeck up lt messagetext gt lt message gt lt messages gt Ma smscentral Page 16 support smscentral com au 1300 971 093 What you ll notice in the response is that the lt messages gt tag is a container holding a collection of lt message gt tags Each lt messagetag gt and the elements within each lt message gt tag contain the details of the individual message Check out our API reference for other possible responses such as the case where there is an error or no messages found If you are using the PHP programming language for your development you might use the SimpleXML library to parse this XML response Here s a PHP code example of how to get the data into variables In the example below we ll just get the text of the first message into a variable and output it to the screen This can be done with just about any programming language that has XML parsing libraries or capability we ll add more and more code samples with different languages over time or let us know if you need some help The following code is continued on from the previous code sample within this Checking for replies On Demand section continued from the
11. his one this is the parameter that contains the text of your message Remember a message is 160 characters in length Any longer than that and it will be sent as 2 messages or 3 messages etc Ma smscentral Page 4 support smscentral com au 1300 971 093 Some code Now that you know what you need to send let s delve into the code itself and how you would do it We are providing a PHP example here below however this can be done with any programming language we ll add more and more code samples with different languages over time or let us know if you need some help lt php pe mae WRG LOr SMS Cemcical S API wasre yowe BINS POSE sinoulel be sent S suri https my smscentral com au api v3 0 Te replace the value of this variable with your username 2 parameters USERNAME your username Je x replac th value of this variable with your password a Sparameters PASSWORD your password Ts 3 this should always be send ROR sending a message a Sparameters ACTION send Je to send from SMS Central s pool of shared numbers use the string value shared otherwise you may use the actual dedicated number that you have for your account if Sparameters ORIGINATOR shared x this is the mobile number of the person you want to send this message to We recommend using internationa
12. l format without the sign Here s an example Australian mobile replace this with the Ma smscentral Page 5 support smscentral com au 1300 971 093 actual mobile you want to send to a Sparameters RECIPIENT 61420314421 Tx The reference parameter this should always be unique string This is the value that will let you match replies with the original outbound message Here s an example on generating a random value though you may venti OmU Se mnie Sm elicit are of some significance to you such as the ID of the outbound message in your database etc x Sparameters REFERENCE rand 0 getrandmax Sparameters REFERENCE healsih mda 9 Sparameters REFERENCE I ee Place your message text here Remember 1 SMS is 160 characters including spaces ee Sparameters MESSAGE TEXT Hi Homer you have an appointment with DRE Nick tomorrow at Le SOSMA e Now we can send the the HTTP POST to SMS Central with all the required parameters We ll do it with cURL if Srequest W foreach Sparameters as Skey gt Svalue Srequest Skey S value amp rtrim S request amp sch curl anit 7 curlsetepitsch CURLOPT URE Gurl Set the URL curl setepriech CURLOPT RETURNIRANSEER 1 M Return kas a variable curl _setopt ch CURLOPT POST true Set POST method curl setopt
13. n through it here for you to get you going It all begins with a HTTP POST to the SMS Central API URL Since this is just one single message here are the required parameters as described by the API Reference that will apply USERNAME This is your SMS Central username PASSWORD This is your SMS Central password ACTION As you are checking for received messages the value for this parameter will always be read DATES TART You can determine how far back you want to check for messages by providing a date value in Datetime format i e 2011 12 25 00 00 00 for this parameter DATEEND You can determine the cut off date for how recent messages can be by providing a date value in Datetime format i e 2011 01 24 23 59 59 for this parameter STATUS You can determine whether you want to check for all messages or only unread messages or messages marked as read with the values ALL UNREAD or READ respectively Ma smscentral Page 12 support smscentral com au 1300 971 093 So given these parameters let s run through the example with code where you only want to check for unread messages that you received yesterday Some code The following code example will show you how you can check for unread messages that were received yesterday You can change the parameter values to check for different times and different message status The code example we are providin
14. o prevent anyone from sending you fake inbound messages You can check the reference value against your database to find the corresponding message p that you actually sent to this person who has replied If you expected a response you can parse the messagetext value For example if you want to Ma smscentral Page 10 support smscentral com au 1300 971 093 check if the reply is a Yes or a No you can use the following code If preg_match yes i messagetext Reply was s a Yes You can perform an action based on this else If preg_match Ano i messagetext Reply was s a No You can perform an action based on this gt Essentially that s all the code you need in order to receive messages You re now all set to send reminder amp notifications messages and receive real time replies Ma smscentral Page 11 support smscentral com au 1300 971 093 Checking for Replies On Demand There are a few reasons you might not want real time replies Here are a a few Due to security reasons you don t allow any server to POST to you or your server is not available all the time or you may not be willing to take on the potential load that real time replies might have on your server So we let you check for replies when you re good and ready instead It s simple too It s all explained on Page 12 of the SMS Central API Reference though we ll ru
15. or or Kenneth at hello smscentral com au Make sure you add API to the Subject of your email OTHER SHENANIGANS We are working really hard to improve SMS Central API As part of this project we will be adding new support tools shortly Thanks for your patience Ma smscentral Page 26 support smscentral com au 1300 971 093
16. p ch curl_init curl setopt ch CURLOPT_URL url Set the URL curl setopt ch CURLOPT_RETURNTRANSFER 1 Return as a variable curl setopt ch CURLOPT_POST true Set POST method curl setopt ch CURLOPT_POSTFIELDS request Set the POST Variables response curl_exec ch Execute the Request curl_close ch Close the CURL handle IA the response variable should now contain the response with all the unread messages This will be in XML format check out the next part of this guide to help you through this ye gt So the above code will send the HTTP POST through to SMS Central requesting all the unread received messages for yesterday Note Once you have requested these messages they will be marked as read If you want to retrieve them again you ll need to use the READ value for the STATUS parameter Ma smscentral Page 15 support smscentral com au 1300 971 093 The Response You Will Receive If there are messages you will get an XML Response It llbe in the following format lt messages gt lt message gt lt datestamp gt 201 1 12 26 15 14 13 lt datestamp gt lt direction gt MO lt direction gt lt originator gt 61 Xxxxxxxxx lt originator gt lt recipient gt 61 Xxxxxxxxx lt originator gt lt messagetext gt Doh Hi Dr Nick it s Homer here can re schedule lt messagetext gt lt message gt lt message
17. p an inbound SMS service In case you re yet to decide whether you want replies in real time or not we ll run through the API code for both methods Receive Replies in Real Time Excellent choice it s easy to implement too By now you re familiar with the API and the parameters as you ve used them to send an SMS These are the same parameters that will be supplied to your server when you receive an SMS Before implementing this the one thing you should be aware of is that you ll need to set up an inbound SMS service by logging in to your SMS Central account where you can enter the URL where you d like the replies to be forwarded to We recommend using a secure HTTPS URL To receive replies in real time SMS Central will be sending these replies to your server with an HTTP POST The parameters you should be expecting in that HTTP POST are Ma smscentral Page 8 support smscentral com au 1300 971 093 USERNAME This is your SMS Central username PASSWORD This is your SMS Central password ORIGINATOR This is the number of the person who is sending the reply message RECIPIENT This is the number that the reply is going to Basically this will be the number that you sent your message from If you used shared then the reply will be to the SMS Central shared number that was used to send your original outbound message REFERENCE When SMS Central matches this reply message with the original m
18. que must be unique reference value which is relevant to you and you ll get the same reference value with any reply so that you can match the reply to the original sent message MESSAGE_TEXT You ll probably have guessed this one this is the parameter that contains the text of your message Remember a message is 160 characters in length any longer than that and it would be sent as 2 messages roro messages etc Ma smscentral Page 21 support smscentral com au 1300 971 093 Some code Now that you Know what you ll need to send let s delve into the code itself and how you would do it We are providing a PHP example here below however this can be done with any programming language we ll add more and more code samples with different languages over time or let us know if you need some help lt php The URL for SMS Central s API where your HTTP POST should be sent Ay url https my smscentral com au api v3 0 Wes replace the value of this variable with your username ay parameters USERNAME your username is replace the value of this variable with your password S parameters PASSWORD your password a this should always be send for sending a message z parameters ACTION send Ma smscentral Page 22 support smscentral com au 1300 971 093 type in the alphanumeric name you want the message to come from
Download Pdf Manuals
Related Search
Related Contents
Sony 4-115-669-11(1) DVD Player User Manual Contabilidade Pública Eletrônica Untitled Kenmore 385.16231 Sewing Machine User Manual PDF Burnham C Series Specification Sheet Operating instructions en ja ko zh cn CameraMator User Manual Fascicolo Tecnico Frigo Lamar 2006 Notice d`installation et de mise en service Stations de transfert d Copyright © All rights reserved.
Failed to retrieve file