Issuing an html POST is easy, but how to receive a callback POST? (1 Viewer)

Auntiejack56

Registered User.
Local time
Today, 12:47
Joined
Aug 7, 2017
Messages
175
Hi,
I'm sending and receiving SMS from Access, and it works very well using email-to-SMS conversion provided by a 3rd party.

I'm now moving to an environment where creating and reading emails from the vba will not be available.
I've tested using a POST to an API (provided by same 3rd party) - this works great in sending the SMS, no problems at all.

But SMS replies are in the form of a callback POST from the 3rd party which contains the text of the SMS. I'll have to somehow accept the POST, consume the JSON and update the database.

Am I correct in assuming that this part can't be done in the VBA, or directly in the SQL database? If so, can anybody point me in the right direction for this part of the solution? A lot of searching on the Web has yielded very little, but there must be a ton of stuff actually out there that works similarly.

Thanks,

Jack
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:47
Joined
Oct 29, 2018
Messages
21,358
Hi Jack. I'm about to go to bed and a little sleepy now, so I may not be thinking correctly at the moment. My guess is you use POST to send the SMS and then use GET to retrieve it. Just a thought...
 

isladogs

MVP / VIP
Local time
Today, 01:47
Joined
Jan 14, 2017
Messages
18,186
Yes it can be done in VBA.
Around five years ago, I setup a system to both send and receive SMS and voicemail using Twilio as the provider.
I chose to use CSV rather than JSON as at that time I knew little about JSON.
However the approach is the same whichever file format you use.

I've had no need to use this recently and cannot remember the details off the top of my head.
However, you can find out more about how I developed this by reading this lengthy thread which was my very first on joining AWF.

If you do a forum search for Twilio and my username, you will get two pages of hits....
 

Auntiejack56

Registered User.
Local time
Today, 12:47
Joined
Aug 7, 2017
Messages
175
Thanks DB, in fact the 3rd party I'm using doesn't allow you to poll using GET to pick up messages.
But it may be the case that there are other SMS providers that do allow you to GET your messages. I'll have a look along those lines - it would be a far easier solution.
Jack
 

Auntiejack56

Registered User.
Local time
Today, 12:47
Joined
Aug 7, 2017
Messages
175
Well, there you go, isla has indeed done exactly that - used a provider that allows you to GET your own message log and parse out the messages.

Fabulous, we are cooking with gas. I've started ploughing through that thread Isla, and there is light at the end of the tunnel.

Thanks both.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:47
Joined
Oct 29, 2018
Messages
21,358
Well, there you go, isla has indeed done exactly that - used a provider that allows you to GET your own message log and parse out the messages.

Fabulous, we are cooking with gas. I've started ploughing through that thread Isla, and there is light at the end of the tunnel.

Thanks both.
Have a good night. Zzzzzzz
 

sonic8

AWF VIP
Local time
Today, 02:47
Joined
Oct 27, 2015
Messages
998
But SMS replies are in the form of a callback POST from the 3rd party which contains the text of the SMS. I'll have to somehow accept the POST, consume the JSON and update the database.

Am I correct in assuming that this part can't be done in the VBA, or directly in the SQL database?
If you mean that the 3rd party is intending to send a POST request to a web service of yours, then you are correct, and it cannot be done with Access/VBA. - In theory it can, but there are so many strings attached that is practically not feasible.
In this case a possible solution would be to set up a web service in the cloud which accepts the POST and stores the information in a database which you then poll from Access.
 

isladogs

MVP / VIP
Local time
Today, 01:47
Joined
Jan 14, 2017
Messages
18,186
Well, there you go, isla has indeed done exactly that - used a provider that allows you to GET your own message log and parse out the messages.

Fabulous, we are cooking with gas. I've started ploughing through that thread Isla, and there is light at the end of the tunnel.

Thanks both.
The thread acts as a chronicle showing how the project progressed at the time.
It also includes some of the code used & there is more in some of the other threads on this forum
It took me a few weeks to get the receive part fully working but it worked perfectly.

NOTE: I have no affiliation with Twilio but I remember that their help/support was excellent.
 

Users who are viewing this thread

Top Bottom