APIs & Integrations

JRashid
Member

Unable to Associate Crisp Conversation with HubSpot Ticket

Hi,

I'm using Crisp to create tickets in HubSpot via the API. I can successfully create a ticket and associate it with the correct contact, and the contact details appear in the ticket's contact section. However, I'm unable to associate the specific Crisp conversation with the created ticket.

In the Crisp contact section, I can see the conversations, but they are not linked to the ticket in HubSpot. I tried using the Conversations API, but it only returns inbox messages or conversations and not the Crisp conversations I want to associate.

Here’s a snippet of my current implementation:
const ticketData = { properties: { hs_pipeline: process.env.HUBSPOT_TECH_SUPPORT_PIPELINE_ID, // TechSupport Pipeline ID hs_pipeline_stage: process.env.HUBSPOT_PIPELINE_STAGE, // Pipeline stage ID hs_ticket_priority: 'HIGH', subject: `Crisp ticket - ${body?.ticketContent}`, content: body?.ticketContent, hubspot_owner_id: owner?.id ? owner?.id : '', // Owner ID based on the operator }, }; if (contact) { ticketData['associations'] = [ { to: { id: contact?.id }, types: [ { associationCategory: 'HUBSPOT_DEFINED', associationTypeId: 16 }, // Contact ↔ Ticket ], }, ]; } const hubspotTicket = await axios.post(HS_BASE_URL_TICKETS, ticketData, hubSpotAuth);

Screenshot_148.pngScreenshot_149.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
0 Upvotes
7 Replies 7
kennedyp
Community Manager
Community Manager

Unable to Associate Crisp Conversation with HubSpot Ticket

Hey @JRashid! Thanks for these details. I think there is some confusion due to the naming of Conversations in Crisp versus Conversations in HubSpot. I haven't used this integration, but it seems like the conversations that naturally create tickets in HubSpot are not related to the Crisp integration

 

Your goal is to see Crisp activity on the ticket, but the integration does not sync to tickets. It sounds like ultimately a limitation of the integration, but maybe some community members with custom integration experience can offer some advice. 

 

Hey @Humashankar, @HubSpot_Corey do y'all know of a way to associate activities synced from an integration to an associated ticket? The conversations don't behave like regular HubSpot Conversations, so we are a bit stuck. 

 

Best,

Kennedy


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
JRashid
Member

Unable to Associate Crisp Conversation with HubSpot Ticket

Yes its not behave like regular HubSpot Conversations and am unable to see it in inbox that's why am not able to get it via conversation api.

0 Upvotes
JRashid
Member

Unable to Associate Crisp Conversation with HubSpot Ticket

We are using crisp input to createt tiekct.
am creatign ticket from api from my node backend.

i am successfully creating ticket and associateing that ticket to the user and can see contact details of that use in ticket contact section...

i want to add or associate that specific conversation to the created ticket how i can do this ?

in crisp contact section i can see the conversation but can not see it in the created ticket also unable to assocaite....

i have used conversation api's but it returns the inbox messages or conversations not the crisp conversations..

Screenshot_148.pngScreenshot_149.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

```

 const { body } = req;
  const apiKey = process.env.HUBSPOT_API_KEY;
  if (!apiKey) {
    throw new AppError(StatusCodes.INTERNAL_SERVER_ERROR, 'HubSpot API key is missing', true);
  }
  const hubSpotAuth = {
    headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` },
  };
 
  const [firstName, lastName] = body.operator.split(' ');
  const loggedInUserEmail = body.userEmail;
  let contact = await axios.get(HS_BASE_URL_CONTACTS,hubSpotAuth)
  contact = contact?.data?.results
  contact =  contact?.find((c)=>c.properties.email===loggedInUserEmail)
  const response = await axios.get(HS_BASE_URL_OWNER, hubSpotAuth);
  const owner = response.data?.results?.find((o) =>
    o?.email?.toLowerCase().includes(firstName.toLowerCase()),
  );
  const lastTicket = await CrispTicket.findOne().sort({ ticketNumber: -1 });
  const nextTicketNumber = lastTicket ? lastTicket.ticketNumber + 1 : 1;
  if (!body.ticketContent) {
    throw new AppError(StatusCodes.BAD_REQUEST, 'Ticket content is required', true);
  }


  const ticketData = {
    properties: {
      hs_pipeline: process.env.HUBSPOT_TECH_SUPPORT_PIPELINE_ID,   
      hs_pipeline_stage: process.env.HUBSPOT_PIPELINE_STAGE,   
      hs_ticket_priority: 'HIGH',
      subject: `Crisp ticket - ${body?.ticketContent}`,
      content: body?.ticketContent,
      hubspot_owner_id: owner?.id ? owner?.id : '',
    },
  };
  if(contact){
    ticketData['associations'] = [
      {
        "to": {
          "id": contact?.id
        },
        "types": [
          {
            "associationCategory": "HUBSPOT_DEFINED",
            "associationTypeId": 16
          }
        ]
      },
      // {
      //   "to": {
      //     "id": contact?.id
      //   },
      //   "types": [
      //     {
      //       "associationCategory": "HUBSPOT_DEFINED",
      //       "associationTypeId": 278
      //     }
      //   ]
      // }
    ]
  }
  try {
    const hubspotTicket = await axios.post(HS_BASE_URL_TICKETS, ticketData, hubSpotAuth);


```

i also try to assoiciate with 278 which is ticket to converation association & got error.

Humashankar
Key Advisor

Unable to Associate Crisp Conversation with HubSpot Ticket

Hi @JRashid 

Looks like you are creating the ticket in HubSpot using the Tickets API (which you're already doing). Following to that can you also try retrieve the Crisp conversation details and Create a conversation record in HubSpot using the Conversations API. Then associate the created conversation with the ticket and give a try and let us know.

 

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

 

Humashankar VJ
HubSpot Enthusiast and Key Advisor | Engineering Manager
0 Upvotes
JRashid
Member

Unable to Associate Crisp Conversation with HubSpot Ticket

Crisp chat conversations are not showing in inbox or in any channel of inbox that's why am not able to get it i have tried all api's too.

https://api.hubapi.com/conversations/v3/conversations/inboxes
https://api.hubapi.com/conversations/v3/conversations/threads 
https://api.hubapi.com/conversations/v3/conversations/channels 
https://api.hubapi.com/conversations/v3/conversations/channel-accounts  

also checked channel by id account by id. 



0 Upvotes
PamCotton
Community Manager
Community Manager

Unable to Associate Crisp Conversation with HubSpot Ticket

Hey @JRashid, happy Tuesday.

 

Thank you for the details and code snippet. It looks like you're successfully creating tickets in HubSpot and associating them with users, but the Crisp conversations aren't appearing in the ticket. 

 

I would recommend resolving this, ensuring you're using the correct conversation ID, and associating it with the ticket. To our top experts, @TomM2 and @DanielSanchez do you have any recommendations for @JRashid matter?

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




JRashid
Member

Unable to Associate Crisp Conversation with HubSpot Ticket

 

I am trying to associate a Crisp conversation with a HubSpot ticket using the following API endpoint:

PUT 'https://api.hubapi.com/crm/v3/objects/tickets/19266708331/associations/conversations/{conversation-i...

 

The issue I’m facing is that I don’t know how to retrieve the correct conversation-id.

I’ve used the Conversations API to fetch conversations, but it only provides inbox conversations, not Crisp conversations or messages. Because of this, I am unable to get the necessary conversation-id to associate it with the ticket.

Could you please guide me on how to retrieve Crisp conversation IDs or if there is an alternative method to associate Crisp conversations with HubSpot tickets?

Thank you for your assistance!

0 Upvotes