Created
February 13, 2019 17:37
-
-
Save jngnyc/874ca301c2ae622b96da05a754f27d26 to your computer and use it in GitHub Desktop.
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
var props = context.getCustomProperties(); | |
console.log("establishment: " + props["establishment"].value); | |
console.log("city: " + props["city"].value); | |
console.log("state: " + props["state"].value); | |
var user = context.getUser(); | |
console.log(user.ipAddress); | |
$.ajax({ | |
type: 'POST', | |
url: "https://instabot-bf1d.restdb.io/rest/first-collection", | |
contentType: "application/json; charset=utf-8", | |
dataType: "json", | |
beforeSend: function (request) { | |
request.setRequestHeader("x-apikey", "5c54b656640ec41c0c24ec50"); | |
request.setRequestHeader("Content-Type", "application/json"); | |
}, | |
data: JSON.stringify({ | |
"establishment": props["establishment"].value, | |
"city": props["city"].value, | |
"state": props["state"].value, | |
"ipaddress": user.ipAddress | |
}) | |
}).done(function (result) { | |
console.log("sorta done?"); | |
console.log("Post result: " + JSON.stringify(result)); | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment