We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b21a12 commit 4859241Copy full SHA for 4859241
app/intercom.py
@@ -23,6 +23,11 @@ def get_text(self):
23
24
# Retrieve a conversation from Intercom API by its ID
25
def fetch_intercom_conversation(conversation_id):
26
+ # Sanitize conversation_id to allow only digits (Intercom conversation IDs are numeric)
27
+ if not conversation_id.isdigit():
28
+ logger.error(f"Invalid conversation_id: {conversation_id}")
29
+ return jsonify({"error": f"Invalid conversation_id: {conversation_id}"}), 400
30
+
31
url = "https://api.intercom.io/conversations/" + conversation_id
32
token = os.getenv('INTERCOM_TOKEN')
33
if not token:
0 commit comments