Templates changes for a few clients.
This commit is contained in:
1
Scripts/GoogleScripts/Talkspace_BBHR/.clasp.json
Normal file
1
Scripts/GoogleScripts/Talkspace_BBHR/.clasp.json
Normal file
@ -0,0 +1 @@
|
||||
{"scriptId":"1fpmVgeHRDeloPnTHHnlFqsmAGERjxWB7qlyDx3rpeB8el3oHfOaRMcZl","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GoogleScripts/Talkspace_BBHR"}
|
||||
49
Scripts/GoogleScripts/Talkspace_BBHR/TalkspaceBBHR.js
Normal file
49
Scripts/GoogleScripts/Talkspace_BBHR/TalkspaceBBHR.js
Normal file
@ -0,0 +1,49 @@
|
||||
function checkBamboo() {
|
||||
const apiKey = 'okhjnTXhK2L96z2TKswBXeHeK';
|
||||
var api_url = 'https://api.northpass.com/v2/apps/bamboo_hr';
|
||||
const settings = {
|
||||
async: true,
|
||||
crossDomain: true,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
accept: 'application/json',
|
||||
'X-Api-Key': apiKey
|
||||
}
|
||||
};
|
||||
const sendMsg = UrlFetchApp.fetch(api_url, settings);
|
||||
var txtResponse = sendMsg.getContentText();
|
||||
var parseProps = JSON.parse(txtResponse);
|
||||
var switched_on = parseProps["data"]["attributes"]["switched_on"];
|
||||
var configured = parseProps["data"]["attributes"]["configured"];
|
||||
console.log(switched_on)
|
||||
console.log(configured)
|
||||
|
||||
// var emailQuotaRemaining = MailApp.getRemainingDailyQuota();
|
||||
// console.log(emailQuotaRemaining)
|
||||
|
||||
// This is just for testing purposes tp make sure the emails work. This setup did.
|
||||
// MailApp.sendEmail("nrasmussen@northpass.com",
|
||||
// "cbencivenga@northpass.com",
|
||||
// "BambooHR Is Down",
|
||||
// "Your Bamboo HR Integration is currently turned off."
|
||||
// );
|
||||
|
||||
if (switched_on == "true" && configured == "true") {
|
||||
MailApp.sendEmail("nrasmussen@northpass.com",
|
||||
"BambooHR Is Down",
|
||||
"Your Bamboo HR Integration is currently turned off."
|
||||
);
|
||||
}
|
||||
|
||||
// var sheet = SpreadsheetApp.openById('1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM');
|
||||
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM/');
|
||||
var sheet = ss.getActiveSheet();
|
||||
var lastRow = sheet.getLastRow()+1;
|
||||
console.log(lastRow)
|
||||
//sheet.getRange(lastRow, 1).setValue(datetime);
|
||||
sheet.getRange(lastRow, 2).setValue(switched_on);
|
||||
sheet.getRange(lastRow, 3).setValue(configured);
|
||||
}
|
||||
|
||||
|
||||
|
||||
7
Scripts/GoogleScripts/Talkspace_BBHR/appsscript.json
Normal file
7
Scripts/GoogleScripts/Talkspace_BBHR/appsscript.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"timeZone": "America/New_York",
|
||||
"dependencies": {
|
||||
},
|
||||
"exceptionLogging": "STACKDRIVER",
|
||||
"runtimeVersion": "V8"
|
||||
}
|
||||
Reference in New Issue
Block a user