Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to get recent CommentEvent

How to get recent CommentEvent

Jamie_Sterling
Shopify Partner
4 0 1

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?

Replies 3 (3)

Liam
Community Manager
3108 342 884

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. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

dj_thossi
Shopify Partner
9 0 1

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

Jamie_Sterling
Shopify Partner
4 0 1

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.