Skip to content

Instantly share code, notes, and snippets.

@mager
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mager/1e554c55706471af576b to your computer and use it in GitHub Desktop.
Save mager/1e554c55706471af576b to your computer and use it in GitHub Desktop.
SmartThings SmartApp Example: SMS to Hue script
<?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