Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Last active December 23, 2015 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kwhinnery/6572230 to your computer and use it in GitHub Desktop.
Save kwhinnery/6572230 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Parse Cloud Code</title>
</head>
<body>
<!-- redonkulously simple UI -->
<input type="text" placeholder="enter phone number"/>
<button>Call This Number</button>
<!-- jQuery, because jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!-- Include the Parse client-side SDK for JavaScript -->
<script src="//www.parsecdn.com/js/parse-1.2.12.min.js"></script>
<!-- Execute our Cloud Code function to make an outbound call -->
<script>
// Initialize with our Parse App ID and JavaScript Key. These are
// Found in your app configuration, under the settings tab, in the
// "Application keys" section
Parse.initialize(
'YOUR_PARSE_APP_ID',
'YOUR_PARSE_JAVASCRIPT_KEY'
);
// make a call when our button is clicked
$('button').on('click', function() {
// Invoke our cloud function, using the phone number in the text field
Parse.Cloud.run('makeCall', {
to: $('input').val() // the value in the text field
}, {
// Success handler
success: function(message) {
alert('Success: ' + message);
},
// Error handler
error: function(message) {
alert('Error: ' + message);
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment