Google App Scriptで会社取得
const BU = 'https://api.hubapi.com';
const props = PropertiesService.getScriptProperties().getProperties();
function myFunction() {
const endpoint = `${BU}/crm/v3/objects/companies`;
const options = {
'method': 'get',
'headers' : {
'Content-Type' : 'application/json',
'Authorization': 'Bearer '+ props.AT
},
};
const response = UrlFetchApp.fetch(endpoint, options);
const responseContent = JSON.parse(response.getContentText());
console.log(responseContent['results'].map(v => {
return `${v.id}: ${v.properties.name}`
}));
}