[HubSpot]Google App Scriptで会社取得

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}`
  }));
}

投稿者: kinkun

保有資格 Salesforce Certified Platform App Builder T Salesforce Certified Platform Developer I Salesforce Certified Platform Developer II Salesforce Certified Administrator

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です