Comments (10)
Thanks @TasosVellis I'll have a look and see what's going on. This service is run by Twilio so I have limited visibility but I'll figure it out.
from twilio-and-sendgrid-python-course.
Thank you for your time and effort @mikeckennedy . Awesome course by the way!
from twilio-and-sendgrid-python-course.
Hey @TasosVellis Glad you're enjoying the course. :)
I just tested the API and it works when called correctly. It seems like some parameter is missing and rather than doing the proper error handling, the API crashes. It should return status code 400 or 422 with a reason (like this value is missing or invalid).
Here's what you get when the Twilio Studio widget converts this to at GET
call.
The response is:
{
"total": 15.5
}
from twilio-and-sendgrid-python-course.
The problem appears for me when I test the flow in Whatsapp. If I try the api call through Postman,Chrome etc. Everything works as expected.
from twilio-and-sendgrid-python-course.
Hey. There very likely means that the specification in Twilio studio on the HTTP widget is wrong. Because it should be doing the same identical thing as calling it in Postman. Is it POST vs. GET? Some variable missing? Have a look.
from twilio-and-sendgrid-python-course.
That's funny, I switched it to a POST request in Twilio studio and it worked!In the course it is a GET
from twilio-and-sendgrid-python-course.
Hi @TasosVellis . Weird. I fiddled with this in the studio and it work. I even put it back to GET and it works. I wonder if something needed refreshing on the Twilio Studio side? I'm confused because it seems unchanged but there it is. I did change from http to https on the address but not sure it matters.
from twilio-and-sendgrid-python-course.
Hey @TasosVellis, apologies for dredging this back up, but I brought up this issue with our product team. In particular, it sounds like the WhatsApp API was throwing a 500 when you were missing some parameters. Can you give me some more insight about what was happening under the hood? What parameters were missing, and what endpoint were you trying to hit? Even better, if you have any SIDs for the errors you were getting, that'd be super helpful!
from twilio-and-sendgrid-python-course.
Thanks for looking into this @ayyrickay
from twilio-and-sendgrid-python-course.
@ayyrickay Sorry for taking so long to respond, but I have been busy with personal matters. Here is the log from the execution
{ "flow": { "flow_sid": "FW0826cbe73e8580e2cfb0887ac750339b", "variables": { "flavour": "red velvet, chocolate, vanilla, carrot, rainbow", "topping": "sprinkles, bacon, Happy Birthday, sugar carrots", "frosting": "cream cheese, chocolate, vanilla, maple" }, "channel": { "address": "whatsapp:+14155238886" }, "sid": "FNce62f7f3cea6b27ba50da9c653a3fd34" }, "widgets": { "TestCakeTopping": {}, "PriceCake": { "status_code": 500, "content_type": "", "body": "" }, "AskCakeTopping": { "inbound": { "ApiVersion": "2010-04-01", "SmsSid": "SM7cefbccc31140d0ad51fbe709bb2abdd", "SmsStatus": "received", "SmsMessageSid": "SM7cefbccc31140d0ad51fbe709bb2abdd", "NumSegments": "1", "ProfileName": "Tasos", "To": "whatsapp:+14155238886", "From": "whatsapp:+306988030210", "MessageSid": "SM7cefbccc31140d0ad51fbe709bb2abdd", "WaId": "306988030210", "Body": "Bacon", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "NumMedia": "0" }, "outbound": { "Status": "queued", "ApiVersion": "2010-04-01", "MessagingServiceSid": null, "DateUpdated": "2022-03-04T23:55:59Z", "DateCreated": "2022-03-04T23:55:59Z", "NumSegments": "1", "From": "whatsapp:+14155238886", "Direction": "outbound-api", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "Sid": "SM1d5f15a908944a97a7a1da81a0c1d380", "DateSent": null, "PriceUnit": null, "Price": null, "SubresourceUris": { "media": "/2010-04-01/Accounts/AC518c80acf29ab7e5d550c7b7a29d57b3/Messages/SM1d5f15a908944a97a7a1da81a0c1d380/Media.json" }, "ErrorCode": null, "To": "whatsapp:+306988030210", "ErrorMessage": null, "Body": "Finally, let's pick a topping for your Rainbow cake with Chocolate. We have sprinkles, bacon, Happy Birthday, sugar carrots.", "NumMedia": "0" } }, "Welcome": { "inbound": { "ApiVersion": "2010-04-01", "SmsSid": "SM939ab56c96cb7d05e8d76c2f97ad5470", "SmsStatus": "received", "SmsMessageSid": "SM939ab56c96cb7d05e8d76c2f97ad5470", "NumSegments": "1", "ProfileName": "Tasos", "To": "whatsapp:+14155238886", "From": "whatsapp:+306988030210", "MessageSid": "SM939ab56c96cb7d05e8d76c2f97ad5470", "WaId": "306988030210", "Body": "Small", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "NumMedia": "0" }, "outbound": { "Status": "queued", "ApiVersion": "2010-04-01", "MessagingServiceSid": null, "DateUpdated": "2022-03-04T23:55:43Z", "DateCreated": "2022-03-04T23:55:43Z", "NumSegments": "1", "From": "whatsapp:+14155238886", "Direction": "outbound-api", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "Sid": "SMab5bebf53a694f75b77fa04c4f98f9ab", "DateSent": null, "PriceUnit": null, "Price": null, "SubresourceUris": { "media": "/2010-04-01/Accounts/AC518c80acf29ab7e5d550c7b7a29d57b3/Messages/SMab5bebf53a694f75b77fa04c4f98f9ab/Media.json" }, "ErrorCode": null, "To": "whatsapp:+306988030210", "ErrorMessage": null, "Body": "Greetings from Cloud City Co. What size of cake would you like? We have small, medium, and large.", "NumMedia": "0" } }, "CheckSize": {}, "AskCakeFlavor": { "inbound": { "ApiVersion": "2010-04-01", "SmsSid": "SMcfe760a950d4a83e7171738a5c9dd9de", "SmsStatus": "received", "SmsMessageSid": "SMcfe760a950d4a83e7171738a5c9dd9de", "NumSegments": "1", "ProfileName": "Tasos", "To": "whatsapp:+14155238886", "From": "whatsapp:+306988030210", "MessageSid": "SMcfe760a950d4a83e7171738a5c9dd9de", "WaId": "306988030210", "Body": "Rainbow", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "NumMedia": "0" }, "outbound": { "Status": "queued", "ApiVersion": "2010-04-01", "MessagingServiceSid": null, "DateUpdated": "2022-03-04T23:55:47Z", "DateCreated": "2022-03-04T23:55:47Z", "NumSegments": "1", "From": "whatsapp:+14155238886", "Direction": "outbound-api", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "Sid": "SMf58ea00457e14ef3ab29738e094c6354", "DateSent": null, "PriceUnit": null, "Price": null, "SubresourceUris": { "media": "/2010-04-01/Accounts/AC518c80acf29ab7e5d550c7b7a29d57b3/Messages/SMf58ea00457e14ef3ab29738e094c6354/Media.json" }, "ErrorCode": null, "To": "whatsapp:+306988030210", "ErrorMessage": null, "Body": "Great! What flavor of cake do you want? We have red velvet, chocolate, vanilla, carrot, rainbow", "NumMedia": "0" } }, "TestCakeFlavor": {}, "Menu": { "flavour": "red velvet, chocolate, vanilla, carrot, rainbow", "topping": "sprinkles, bacon, Happy Birthday, sugar carrots", "frosting": "cream cheese, chocolate, vanilla, maple" }, "TestCakeFrosting": {}, "GetMenu": { "status_code": 200, "content_type": "application/json", "parsed": { "flavour": [ "red velvet", "chocolate", "vanilla", "carrot", "rainbow" ], "topping": [ "sprinkles", "bacon", "Happy Birthday", "sugar carrots" ], "frosting": [ "cream cheese", "chocolate", "vanilla", "maple" ] }, "body": "{\"flavour\":[\"red velvet\",\"chocolate\",\"vanilla\",\"carrot\",\"rainbow\"],\"topping\":[\"sprinkles\",\"bacon\",\"Happy Birthday\",\"sugar carrots\"],\"frosting\":[\"cream cheese\",\"chocolate\",\"vanilla\",\"maple\"]}" }, "AskCakeFrosting": { "inbound": { "ApiVersion": "2010-04-01", "SmsSid": "SM09fccf01a9b1747a955e7aa077c6067e", "SmsStatus": "received", "SmsMessageSid": "SM09fccf01a9b1747a955e7aa077c6067e", "NumSegments": "1", "ProfileName": "Tasos", "To": "whatsapp:+14155238886", "From": "whatsapp:+306988030210", "MessageSid": "SM09fccf01a9b1747a955e7aa077c6067e", "WaId": "306988030210", "Body": "Chocolate", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "NumMedia": "0" }, "outbound": { "Status": "queued", "ApiVersion": "2010-04-01", "MessagingServiceSid": null, "DateUpdated": "2022-03-04T23:55:53Z", "DateCreated": "2022-03-04T23:55:53Z", "NumSegments": "1", "From": "whatsapp:+14155238886", "Direction": "outbound-api", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "Sid": "SMf033ae17665442df87b166ae248a0ce5", "DateSent": null, "PriceUnit": null, "Price": null, "SubresourceUris": { "media": "/2010-04-01/Accounts/AC518c80acf29ab7e5d550c7b7a29d57b3/Messages/SMf033ae17665442df87b166ae248a0ce5/Media.json" }, "ErrorCode": null, "To": "whatsapp:+306988030210", "ErrorMessage": null, "Body": "Rainbow cake sounds delicious. What frosting do you want to pair it with? We have cream cheese, chocolate, vanilla, maple", "NumMedia": "0" } } }, "contact": { "channel": { "address": "whatsapp:+306988030210" } }, "trigger": { "message": { "ApiVersion": "2010-04-01", "SmsSid": "SMfb608ab2e64d1d8f578ef1b026e80e7a", "SmsStatus": "received", "SmsMessageSid": "SMfb608ab2e64d1d8f578ef1b026e80e7a", "ProfileName": "Tasos", "NumSegments": "1", "From": "whatsapp:+306988030210", "To": "whatsapp:+14155238886", "WaId": "306988030210", "MessageSid": "SMfb608ab2e64d1d8f578ef1b026e80e7a", "Body": "Hi", "AccountSid": "AC518c80acf29ab7e5d550c7b7a29d57b3", "NumMedia": "0" } } }
I believe the Flow SID you are requesting is this FW0826cbe73e8580e2cfb0887ac750339b
and here are the properties from the log
Execution SID
FNce62f7f3cea6b27ba50da9c653a3fd34
Contact SID
FC28166f7392a30694bfa0f9a11089ecdb
Flow SID
FW0826cbe73e8580e2cfb0887ac750339b
Triggered By
Incoming Message
Trigger SID
SMfb608ab2e64d1d8f578ef1b026e80e7a
Revision
80
from twilio-and-sendgrid-python-course.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twilio-and-sendgrid-python-course.