backedup cin7 templates. Cloned more courses. Domains to csv for anthology was completed. new GAS script for cin7 courses within a google sheet.
This commit is contained in:
26
Scripts/GAS_GS/Cin7-Courses-List/PullCourses.js
Normal file
26
Scripts/GAS_GS/Cin7-Courses-List/PullCourses.js
Normal file
@ -0,0 +1,26 @@
|
||||
const apiKey = "51BNlRsLYKQxSu1q1UQq7F63j"
|
||||
|
||||
function getCourses() {
|
||||
let page = 0
|
||||
while (page >= 0) {
|
||||
page++
|
||||
Logger.log(page)
|
||||
var apiURL = 'https://api.northpass.com/v2/courses?limit=100&page='+page;
|
||||
const settings = {
|
||||
async: true,
|
||||
crossDomain: true,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
accept: 'application/json',
|
||||
'X-Api-Key': apiKey
|
||||
}
|
||||
};
|
||||
const sendMsg = UrlFetchApp.fetch(apiURL, settings);
|
||||
var txtResponse = sendMsg.getContentText();
|
||||
var parseProps = JSON.parse(txtResponse);
|
||||
|
||||
if (parseProps["links"]["next"] == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user