Need chat ID in Javascript API for Zendesk Chat

回答済み

10 コメント

  • Ramin Shokrizadeh
    コメントアクション Permalink

    Hi there Wesley,

    Thanks for sharing your request. Can you elaborate on what you are trying to accomplish? The chat ID does not get created until the chat session ends on the widget and we don't surface the chat ID to the widget at the moment. 

    -Ramin

    0
  • Wesley Lau
    コメントアクション Permalink

    Hi Ramin,

    An elaboration on my request: we are currently trying to use the Rest API to get the associated zendesk ticket of the chat, and add a comment to that ticket. If we had the chat ID of the current session, then we could just do a lookup using `chats/{id}`, and then access `zendesk_ticket_id` to alter in Zendesk.

    0
  • Ramin Shokrizadeh
    コメントアクション Permalink

    Hi there Wesley,

    We are working on adding the apps framework to the Chat panel and one of the apps framework APIs is to get the ticket ID for a chat. In theory, you could create an app that would get the ticket ID and add a comment.

    More information on the availability of the apps framework will be available next month.

    Thanks,

    Ramin

    1
  • Wesley Lau
    コメントアクション Permalink

    Great! Looking forward to apps framework. Hopefully it will solve our use case. Thanks!

    0
  • David Xaus
    コメントアクション Permalink

    Hi Ramin,

    I'm looking on the apps framework but can't see nothing to obtain chatid (or ticketId) from chat widget. There's something in place I'm overlooking?

    Also, in case the ticket ID can be retrieved from JS API, how can you match the ticket ID with a chatId on  Zendesk Chat Rest API?

     

    0
  • Ramin Shokrizadeh
    コメントアクション Permalink

    Here is the doc to get the chat ID: https://developer.zendesk.com/apps/docs/chat-api/chat_sidebar#chat.id

    The ticket id is also sent as part of the channel.ticket.created event.

    Once you have the Chat ID, you can use the REST APIs to get the associated Zendesk ticket id: https://developer.zendesk.com/rest_api/docs/chat/chats#get-chat

    -Ramin

     

    0
  • Vijay Kumar
    コメントアクション Permalink

    Hey Rahim,

    Is there any other solution available for this problem. I also need ticket ID to attach a file with it whenever User starts a chat.

    Thanks

    0
  • Ramin Shokrizadeh
    コメントアクション Permalink

    Vijay Kumar there are no other methods beyond what I previously shared above. 

    0
  • Vijay Kumar
    コメントアクション Permalink

    For the method you have mentioned above, do we will have to create app for it or we can call these events directly?

    Since my use case is very straight, i just need to send some additional user info to the agent without users's attention, So i don't think i would need to create an app for it. 

    0
  • Ramin Shokrizadeh
    コメントアクション Permalink

    The APIs are only available via the apps framework, so creating an app is required.

    0

ログインしてコメントを残してください。

Powered by Zendesk