Last active
August 29, 2015 14:23
-
-
Save mager/1e554c55706471af576b to your computer and use it in GitHub Desktop.
SmartThings SmartApp Example: SMS to Hue script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = '<YOUR SMARTAPP ENDPOINT>'; | |
$body = $_REQUEST['Body']; | |
$data = "{'value':'$body'}"; | |
$options = array( | |
'http' => array( | |
'header' => "Authorization: Bearer <YOUR SMARTAPP TOKEN>\nContent-type: application/json", | |
'method' => 'PUT', | |
'content' => $data, | |
), | |
); | |
$context = stream_context_create($options); | |
$result = file_get_contents($url, false, $context); | |
?> | |
<Response> | |
<Message>This message is sent back to the user via SMS</Message> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment