Plain text request body in oauth-enabled SmartApp


(Justin) #1

I’m writing an oauth-enabled SmartApp that exposes an endpoint for the Maker channel on IFTTT. I’m trying to hook it up to the gmail channel so that it essentially sends the message body to my SmartApp.

I’m trying to see exactly what the body ‘ingredient’ from the gmail recipe looks like when it gets to my SmartApp so I’d like to be able to send a content type of text/plain and simply log the result.

All I see in the documentation though is using request.JSON or request.XML. Is there any way to show the plain text?

Thanks,
Justin


(Justin) #2

For anyone interested, I can kind accomplish what I want by sending the email subject instead – it has all the information I need. Problem is either IFTTT or the Gmail channel itself is truncating the subject to 40 characters. Really aggravating. I think that’s enough for my purposes, but still…

The app I’m writing will receive open/close emails from Alarm.com and flip a virtual contact switch upon receipt. I’ll be posting code in a bit. It’s kind of a poor man’s Alarm.com integration. I really just wanted my contact sensors on my doors and windows to show up in SmartThings. The solution I have now works, albeit with some delay.