crm-api-template-generator/backend/utils/getHubspotTicketStatus.js

25 lines
483 B
JavaScript
Raw Permalink Normal View History

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