Open christ0089 opened 4 years ago
I'm not sure what this
refers to. But if it refers to the exported module from /botlib/json_to_proto.js
, try changing this.jsonValueToProto(payload)
to this.jsonToStructProto(payload)
should fix the problem.
FYI, jsonValueToProto
only converts the value in a JSON object into StructProto value. But the payload
variable in your code holds the whole JSON object (including key and value) which should be convert using jsonToStructProto
method.
Feel free to reply if this approach does not work!
jsonToProto functions seems to return proto object but when sent as request object to the fullfilment it returns empty payload.
const payload = { data: { SmsSid: "SM1eb889baa86d1887d14c6007a6c5684a", Body: "Hola", SmsStatus: "received", MessageSid: "SM1eb889baa86d1887d14c6007a6c5684a", ApiVersion: "2010-04-01", From: "whatsapp:+5218717953912", AccountSid: "ACf71ea17bda8928547c7f0fa3f13d384b", NumMedia: "0", To: "whatsapp:+14155238886", SmsMessageSid: "SM1eb889baa86d1887d14c6007a6c5684a", NumSegments: "1" } };