25 lines
495 B
JavaScript
25 lines
495 B
JavaScript
const axios = require('axios')
|
|
|
|
async function getHubspotTicket(token, contactId,) {
|
|
try {
|
|
const config = {
|
|
method: 'get',
|
|
url: `https://api.hubapi.com/crm/v3/objects/contacts/${contactId}/associations/tickets`,
|
|
headers: {
|
|
'Authorization': `Bearer ${token}`,
|
|
"Content-Type": "application/json"
|
|
}
|
|
}
|
|
|
|
const { data } = await axios(config)
|
|
return data
|
|
} catch (error) {
|
|
console.error(error)
|
|
}
|
|
}
|
|
|
|
module.exports = getHubspotTicket
|
|
|
|
|
|
|