Discussions

Expand all | Collapse all

Send a POST request with a button or webhook?

  • 1.  Send a POST request with a button or webhook?

    Posted 05-08-2017 12:20
    So I need to post this when a button is clicked:

    http://weburlgoeshere/push.php?id=[DEVICE_ID]&title=New">http://notifications.plumbingjohannesburg.co.za/push.php?id=[DEVICE_ID]&title=New">http://weburlgoeshere/push.php?id=[DEVICE_ID]&title=New job&msg=You have a new job

    I already have a button that does some edit record functions, all I want to do is add this to the end. Important here is to have the [Device_ID] field inserted into that url before it is sent.

    Hope this is possible.  If not, how will this be done with a webhook?


  • 2.  RE: Send a POST request with a button or webhook?

    Posted 05-09-2017 04:57
    anyone?


  • 3.  RE: Send a POST request with a button or webhook?

    Posted 05-09-2017 14:05
    Hi Geoffrey,

    You can do this easily with QB webhook capability.  The only catch is that your http request becomes an https request.  Since you already have a button that allows you to update or edit the record, then with a webhook function you can send the above url to your php proxy and include any fields, i.e Device_ID.  If you do not have an https server then you might want to execute the url in a popup window to the back-end.


  • 4.  RE: Send a POST request with a button or webhook?

    Posted 05-09-2017 19:14
    I dont have https server, can you elaborate a little bit more on... "executing the url in a popup window to the backend?"  I would like to try this


  • 5.  RE: Send a POST request with a button or webhook?

    Posted 05-09-2017 15:46
    I dont have https server, can you elaborate a little bit more on... "executing the url in a popup window to the backend?"  I would like to try this


  • 6.  RE: Send a POST request with a button or webhook?

    Posted 05-15-2017 13:07
    This is very quick in webhooks but yea you need SSL. You should consider enabling SSL everywhere (can be free with LetsEncrypt). Every site should have SSL regardless of content (even if the user doesn't submit any content). Both browsers and search engines are starting to punish sites without SSL using modern standards. You could in theory go from Quick Base button to a JavaScript page which invokes your PHP. The JavaScript page middle piece is so that you can get a Quick Base one time ticket and then either use that as the authentication server-side (so there are no stored creds) or validate it server-side if you do need to have elevated credentials performing credentials from the server. If you need that, the credentials ideally should be encrypted server-side. Your browsers might throw a mixed content warning (I don't know offhand in that situation) as well if the PHP server is insecure.

    Hope this helps.