Hey @Jess Matthews! Daniel from Customer Support Engineering here
I believe this issue may be related to the fact that you are using “conversation part body”, particularly, for a conversation where said part may not exist. You might find that using “last message body” will give you a similar result, but is more reliable. I see that you are conversing about this in the Messenger with one of my teammates, so I’ll let you take it from there. Could you please share the solution here, once you’ve reached it? Thanks!
Hey Jesse, I am getting the same issue, but for tickets. It wont work with any of the contents of the tickets.
When dealing with sporadic errors in a Custom Action in Intercom, especially when using conversation parts in the payload, it's important to address potential issues with data formatting, encoding, or any special characters that may cause JSON validation errors.
Here are some steps you can take to troubleshoot and potentially resolve the issue:
1. **Data Formatting and Escaping:**
- Ensure that the data you're sending as JSON in the payload is properly formatted and all special characters are correctly escaped. This is crucial for valid JSON. You may need to escape characters like quotes, backslashes, etc.
2. **Handle Special Characters:**
- Conversations can contain various special characters. Make sure you are properly encoding and escaping these characters before sending them in the JSON payload. This includes characters like quotes, ampersands, and other reserved characters.
3. **Check for Unicode Characters:**
- Conversations may include Unicode characters that could cause issues. Ensure that your payload and JSON encoding can handle Unicode characters properly.
4. **Log Detailed Information:**
- In your Custom Action, log detailed information about the payload, including the specific conversation part causing the issue. This can help you pinpoint the problematic data.
5. **Test with Different Conversation Parts:**
- If triggering the Custom Action for one message in the conversation is successful while another fails, compare the content of the conversation parts. Identify any patterns or specific types of content that might be causing the issue.
6. **Update Zapier Settings:**
- If you are using Zapier as the webhook catch URL, ensure that your Zap is configured to handle the dynamic data from Intercom correctly. Check Zapier's task history for more detailed error messages.
7. **Encoding and Decoding:**
- Confirm that your application and Zapier are consistently using the same character encoding. If there's a discrepancy, it can lead to issues with special characters.
9. **Workaround:**
- As a workaround, you might consider modifying your workflow to sanitize or preprocess the data before sending it to the webhook. For instance, you could clean up or replace problematic characters.
If the issue persists and you are unable to pinpoint the cause, involving Intercom support and potentially Zapier support can provide more tailored assistance based on the specifics of your integration and data.