I’m trying to pass the TO and FROM phone numbers using the data filed in Particle.publish and webhooks.
Below is what I have but I get an error 21602
Message body is required.
I tried different options but nothing seems to work and I can only get it working by specifcing the TO and FROM using the form as shown here https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-particle-photon
sms = String::format("{\"From\": %s, \"To\": %s, \"Body\": \"body\"}",setEmailString.c_str(), setPhoneString.c_str());
Particle.publish("twilio_sms", sms, 60, PRIVATE);
{
"event": "twilio_sms",
"url": "https://api.twilio.com/2010-04-01/Accounts/****************************/Messages",
"requestType": "POST",
"noDefaults": true,
"rejectUnauthorized": true,
"json": {
"data": "{{{PARTICLE_EVENT_VALUE}}}"
},
"auth": {
"username": "************************",
"password": "***********************"
}
}