Don’t forget to change the webhook back
YOU DID IT!!!
Seriously your help here has been amazing. I am so grateful.
How did you determine the structure of Twillio’s data like that?
Glad to be of service
I modified that example app I sent you.
I created a Data Table with two columns, “key” & “value”.
I then looped around the kwargs that were received and stored them in the table like this :
@anvil.server.http_endpoint("/test")
def test(**kw):
for k,v in kw.items():
app_tables.log.add_row(key=k,value=v)
Brilliant, and so that let you know about the exact fields that Twillio sends to the Anvil app. Really cool stuff. I’m so out of my element with the web.
I really can’t thank you enough.
Al
Nice to see you’ve got it working!
If you want named keyword arguments, you can supply them explicitly in the signature, and catch any other query parameters with **kw
. Using David’s example:
@anvil.server.http_endpoint("/test")
def test(From=None, Body=None, **kw):
if From is not None:
app_tables.log.add_row(key='From', value=From)
if Body is not None:
app_tables.log.add_row(key='Body', value=Body)
for k,v in kw.items():
app_tables.log.add_row(key=k, value=v)
This is great. Thanks Shaun!