Skip to content

Instantly share code, notes, and snippets.

@jngnyc
Created February 13, 2019 17:37
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 jngnyc/874ca301c2ae622b96da05a754f27d26 to your computer and use it in GitHub Desktop.
Save jngnyc/874ca301c2ae622b96da05a754f27d26 to your computer and use it in GitHub Desktop.
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