Hello,
I have a simple endpoint that receives form data from our website, then creates a contact if needed, creates a ticket, then tries to assign the contact to the ticket… but I am getting an errror. Can anyone point me in the right direction please?
reference: Accounts Dashboard | HubSpot
code:
try { const ticketId = createTicketResponse.id const toObjectType = 'contact' const toObjectId = contactId const associationType = 'contact_to_ticket' associateTicketResponse = await hubspotClient.crm.tickets.associationsApi.create( ticketId, toObjectType, toObjectId, associationType ) } catch (e) { console.log(e) res.status(e.status || 400).json(e.body) }
and my error:
ApiException [Error]: HTTP-Code: 500Message: An error occurred.Body: {"status":"error","message":"internal error","correlationId":"64cf4990-2916-46e6-80ab-70d47e5b5126"}Headers: {"access-control-allow-credentials":"false","alt-svc":"h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400","cf-cache-status":"DYNAMIC","cf-ray":"771883805ab7e6fe-DFW","connection":"close","content-length":"100","content-type":"application/json;charset=utf-8","date":"Tue, 29 Nov 2022 04:13:57 GMT","nel":"{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=%2FFHGVRdi4G9OVV9vnhVKCt3hT9iEnDLcZ0DLPRc8beqIJkIALNY24xqDRbbiF4%2FfJ4%2FoLhqhAwTJSJhXwCbyba7zMxkvUz5WW4dlR9Y8KkuGSKYKTRY5w1nqPHIZDtiS\"}],\"group\":\"cf-nel\",\"max_age\":604800}","server":"cloudflare","strict-transport-security":"max-age=31536000; includeSubDomains; preload","vary":"origin, Accept-Encoding","x-hubspot-correlation-id":"64cf4990-2916-46e6-80ab-70d47e5b5126","x-hubspot-ratelimit-daily":"250000","x-hubspot-ratelimit-daily-remaining":"249921","x-hubspot-ratelimit-interval-milliseconds":"10000","x-hubspot-ratelimit-max":"100","x-hubspot-ratelimit-remaining":"97","x-hubspot-ratelimit-secondly":"10","x-hubspot-ratelimit-secondly-remaining":"9","x-trace":"2B7E4C2907E15A8E8025F8DD7A49AF8EB9BC93A824000000000000000000"}at AssociationsApiResponseProcessor.<anonymous> (/Users/ax0n/Code/asio-earth/node_modules/@hubspot/api-client/lib/codegen/crm/tickets/apis/AssociationsApi.js:163:23)at Generator.next (<anonymous>)at fulfilled (/Users/ax0n/Code/asio-earth/node_modules/@hubspot/api-client/lib/codegen/crm/tickets/apis/AssociationsApi.js:5:58)at processTicksAndRejections (node:internal/process/task_queues:96:5) {code: 500,body: {status: 'error',message: 'internal error',correlationId: '64cf4990-2916-46e6-80ab-70d47e5b5126'},headers: {'access-control-allow-credentials': 'false','alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400','cf-cache-status': 'DYNAMIC','cf-ray': '771883805ab7e6fe-DFW',connection: 'close','content-length': '100','content-type': 'application/json;charset=utf-8',date: 'Tue, 29 Nov 2022 04:13:57 GMT',nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}','report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=%2FFHGVRdi4G9OVV9vnhVKCt3hT9iEnDLcZ0DLPRc8beqIJkIALNY24xqDRbbiF4%2FfJ4%2FoLhqhAwTJSJhXwCbyba7zMxkvUz5WW4dlR9Y8KkuGSKYKTRY5w1nqPHIZDtiS"}],"group":"cf-nel","max_age":604800}',server: 'cloudflare','strict-transport-security': 'max-age=31536000; includeSubDomains; preload',vary: 'origin, Accept-Encoding','x-hubspot-correlation-id': '64cf4990-2916-46e6-80ab-70d47e5b5126','x-hubspot-ratelimit-daily': '250000','x-hubspot-ratelimit-daily-remaining': '249921','x-hubspot-ratelimit-interval-milliseconds': '10000','x-hubspot-ratelimit-max': '100','x-hubspot-ratelimit-remaining': '97','x-hubspot-ratelimit-secondly': '10','x-hubspot-ratelimit-secondly-remaining': '9','x-trace': '2B7E4C2907E15A8E8025F8DD7A49AF8EB9BC93A824000000000000000000'}}