How to get recent CommentEvent

We use the Customer Timeline to add notes - and I want to be able to pull these into a separate CRM via REST/GraphQL.

Yes, we can access commentEvent by customer ID; but there doesn’t seem to be a way to pull the recent commentEvents across all customers? Or know when a customer has new comments to pull by ID.

Potential solutions which don’t work:

  • Use customer updated_at field - but adding a comment doesn’t update customer (ie changing a metafield will update this value, allowing recent changes to be queried)
  • Use Flow to send a webhook, or update a metafield (which can then be queries) - but Flow can’t subscribe to customer update or timeline events
  • There doesn’t seem to be a webhook available when adding a new comment

Is there a solution to this?

Hi Jamie,

It does look like comments that staff leave on the timeline of a customer are not accessible via the customers API - so you’d need to query each individual customer by their ID as you’ve described. I’ve added a product feature request though for a new webhook that would fire when new comment is added, that would contain the content of the comment.

2 Likes

Hey. Yes I would love to have a Webhook for comments too. Especially the CommentEvent comments on order level.

My use case is that our customer service team wants to put details for the production team in shopify at the order including historical entries by using the comment feature. In production they want to be notified proactively when a new comment for them came in.

Please keep me posted as soon as there is a webhook for this. Thank you

If it helps, I’ve hacked a solution which runs a bulkOperation mutation every 10 minutes to request all customers and their most recent commentEvent (could do the same for orders); and then a webhook to process the response. It gives almost-real-time updates which is enough for our use case.