Skip to content

Commit

Permalink
Sync contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-27 committed Mar 16, 2024
1 parent 9f11d32 commit 14b5f4f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
24 changes: 16 additions & 8 deletions packages/api/src/crm/contact/services/attio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,22 @@ export class AttioService implements IContactService {
provider_slug: 'attio',
},
});
const resp = await axios.get(`https://api.attio.com/v2/objects/people/records/query`, {
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.cryptoService.decrypt(
connection.access_token,
)}`,
},
});
console.log("Before Axios")
console.log(this.cryptoService.decrypt(connection.access_token))

const resp = await axios.post(`https://api.attio.com/v2/objects/people/records/query`, {},
{
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${this.cryptoService.decrypt(connection.access_token)}`,
},
}


);

console.log("After Axios")

return {
data: resp.data.data,
Expand Down
5 changes: 3 additions & 2 deletions packages/shared/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ type ProvidersConfig = {

export const providersConfig: ProvidersConfig = {
'crm': {
// Add client id in their respective crm
'hubspot': {
clientId: 'clientid',
clientId: 'Add hubspot requested client id',
scopes: 'crm.objects.contacts.read crm.objects.contacts.write crm.schemas.deals.read crm.schemas.deals.write crm.objects.deals.read crm.objects.deals.write crm.objects.companies.read crm.objects.companies.write crm.objects.owners.read settings.users.read settings.users.write settings.users.teams.read settings.users.teams.write',
authBaseUrl: 'https://app-eu1.hubspot.com/oauth/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
'attio': {
clientId: 'clientid',
clientId: '<Add Attio requested client id>',
scopes: 'record_permission:read',
authBaseUrl: 'https://app.attio.com/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
Expand Down

0 comments on commit 14b5f4f

Please sign in to comment.