How to send SMS to form submitter using my own API?

  • hechzerim
    Asked on August 19, 2014 at 6:21 AM

    Hello everyone,

    I've been searching all around the forum for a solution but could'nt find one.

    I am trying to send a submission automatic text messege to the form filler's mobile.

    I am registered with an API SMS service and I want to send an automatic messege to who ever fills out the form with his name in the text body and so that the phone number he entered will be the reciever number.

    the API service provider sent me a .php file for example.

    I've attached the .php example file.

    your help would be much appreciate!

    the .php example file

     

  • Ashwin JotForm Support
    Replied on August 19, 2014 at 9:42 AM

    Hello hechzerim,

    There are multiple ways to achieve your requirement:

    1. You can set up Webhook to send HTTP POST notification where you can use your own API code to sens SMS notification using your API code. The following guide should help you:  http://www.jotform.com/help/245-How-to-Setup-Webhook-with-JotForm 

    2. You can take advantage of our custom thank you URL to redirect your user to your own PHP page. In this custom PHP page you can use read your form's POST data and use your SMS service provider's API to send SMS. The following guide should help you:  http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page 

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • Hechzerim
    Replied on August 19, 2014 at 11:38 AM

    Thank you for your reply. I hsve tried that already and no success. I have uploaded the php file that the api service provider gave me and its integrated to my form using webhook but it wont send any sms to the submiter. If you could help me and fix the php file to work it would me great. Thank you very much.

  • Ashwin JotForm Support
    Replied on August 19, 2014 at 12:56 PM

    Hello Hechzerim,

    Though I am not a PHP expert but I will give it a try. I will also forward this thread to my colleague as well who is a PHP expert.

    We will get back to you as soon as we have any update on this. 

    Thank you!

  • hechzerim
    Replied on August 20, 2014 at 12:23 AM

    Thank you very much. waiting for your reply.

  • Ashwin JotForm Support
    Replied on August 20, 2014 at 2:19 AM

    Hello hechzerim,

    I haven't started work on it. I will check the API code and get back to you if I have any questions.

    Thank you!

  • hechzerim
    Replied on August 21, 2014 at 8:28 PM

    Hi ashwin_d,

     

    any news?

     

    Thanks.

  • Jeanette JotForm Support
    Replied on August 21, 2014 at 11:43 PM

    I'll forward your request to Ashwin so he can update you.

  • hechzerim
    Replied on August 24, 2014 at 6:30 PM

    someone?

  • jonathan
    Replied on August 24, 2014 at 8:07 PM

    Hi,

    Can you share to us the URL where you have tried this already?

    We will check also what have you created so far.

    Thanks.

  • jonathan
    Replied on August 24, 2014 at 8:12 PM

    I am sorry, I did not realized you had already provided the URL. This onehttp://hechzerim.co.il/%D7%91%D7%95%D7%90%D7%95-%D7%A0%D7%AA%D7%97%D7%99%D7%9C/

    But can you share to us the PHP code of thesendsms page (sendsms.php) in your website where you use the Webhooks to trigger the URL of the sms script.

    Thanks.

  • hechzerim
    Replied on August 25, 2014 at 4:20 AM

    Hi Jonathan,

    This is what I tried to do:

    sendsms .PHP

    Thanks,

  • Welvin Support Team Lead
    Replied on August 25, 2014 at 6:44 AM

    Thank you for providing the codes. We'll check this get back to you.

    Regards

  • hechzerim
    Replied on August 25, 2014 at 2:43 PM

    Thanks.

    Waiting for your reply

  • hechzerim
    Replied on August 30, 2014 at 2:31 PM

    Hi guys,

    Any news?

     

    Thanks

     

  • Elton Support Team Lead
    Replied on August 31, 2014 at 12:07 AM

    Hello hechzerim!

    Our sincere apologies for the delay.

    Please try this PHP script: http://pastiebin.com/54029a7e5ca31. You have to edit the required API details provided by your SMS provider found on this script. After that, save it as a php file, upload it to your server and add it to your form as webhook URL

    Note that this code is untested, simply because we do not have the facility to do so and it is not supported with our country. Therefore we cannot guarantee you of any assurance if it is working or not unless you keep trying and report to us the status of this so we can assist you further with this.

    Furthermore, I have been trying to find the SMS API documentation page you're using so at least we could check and verify the parameters you used in your sample code. Some parameters really confused me specially the Jotform Authentication Key (authkey) which I've found on your sample code. If you know the documentation page, please let us know. That will tell us the correct parameters to include on the post.

    How to send SMS to form submitter using my own API? Image 1 Screenshot 20

    We will wait your test result using this script.

    Thanks!

  • hechzerim
    Replied on August 31, 2014 at 4:16 AM

    Hi EltonCris,

    Thank you for your hard work.

    unfortunately the script you gave me didnt work.

    I will post a link to the documentation file:

    GlobalSms Webservice API.pdf

     

    Maybe this can help.

     

    Thanks

  • jonathan
    Replied on August 31, 2014 at 5:29 AM

    Thank you for the documentation file.

    My colleague have received your message update also. We need time to check this further.

    We will update you here for any status update as soon as we can.

     

    Thanks.

     

  • Elton Support Team Lead
    Replied on August 31, 2014 at 7:11 AM

    Try this: http://pastiebin.com/54029a7e5ca31. I have updated all the variables according to the documentation.

    Again, replace the API Username and Password found on this script and add it as a Webhook URL to your form.

    I hope this works this time. If not, I think it is best to get in contact with your SMS API provider and let them check the php code. This is the best way to get this rectified. I'm sure they will be able to assist you further with this. The php code is written correctly but we just cannot test it here because like I've said earlier the SMS service isn't supported in our country. 

    Best Regards!

  • Elton Support Team Lead
    Replied on August 31, 2014 at 7:23 AM

    Sorry, just updated the username and password variable to "un" and "pw". If you have copied the code after my reply just now, kindly copy it again. Thanks!

  • Ezra
    Replied on February 6, 2017 at 3:48 AM

    I have already built script ans sql database with OTP email token. Please direct me on how to connect sms api to also send the token to user. Thanks
     
  • seth
    Replied on February 6, 2017 at 4:01 AM

    Hello Ezra,

    This is an old thread, so I transferred your question to a new one. Please follow up there:

    https://www.jotform.com/answers/1057502

    Thank you.