open docker in the backgound and run npm install
before deploying
This is a cdk app that will create several lambda functions to read and write contact and company data to and from hubspot
- hubspotGetContact: Obtains a hubspot contact using an email address
- hubspotPostContact: Creates a hubspot contact
- hubspotGetCompany: Obtains a hubspot company using an orgid
- hubspotPostCompany: Creates a hubspot company and contact
- hubspotUpdateContact: Updates contact using email
- hubspotUpdateCompany: Updates company using orgid
- Create a new hubspot developer account
- Create a new private app
Note
- crm.objects.companies.read
- crm.objects.contacts.read
- crm.objects.contacts.write
- crm.objects.companies.write
- Add 'platformr_orgid' to the contact properties
- Add 'platformr_orgid', 'platformr_aws_account_id', 'platformr_product_id' and 'platformr_product_name' to the company properties
Note
- Using the accessToken from the app, create an AWS Secrets Manager secret
- Name the accessToken 'hubspotAccessToken'
- When you rotate the accessToken, you will need to update it through AWS as well
- hubspotContactGet: 'email'
- hubspotContactPost: 'firstname', 'lastname', 'email', 'platformr_orgid'
- hubspotCompanyGet: 'platformr_orgid'
- hubspotCompanyPost: 'firstname', 'lastname', 'email', 'platformr_orgid', 'domain', 'companyname', 'platformr_aws_account_id', 'platformr_product_id', 'platformr_product_name'
- hubspotUpdateContact: 'email' and at least one of the following: 'firstname', 'lastname'
- hubspotUpdateCompany: 'platformr_orgid' and at least one of the following: 'domain', 'companyname', 'platformr_product_id', 'platformr_product_name'
//Post Company Example
{
"firstname":"Brendan",
"lastname":"Bessman",
"email":"Bdbessman@gmail.com",
"platformr_orgid":"1234567890",
"domain":"platformr.cloud",
"companyname":"Platformr",
"platformr_aws_account_id":"1203981",
"platformr_product_id":"54321",
"platformr_product_name":"Example Product Name"
}