Spaces:
Runtime error
Runtime error
Download utils.py from nagasurendra/Dup_Chatbot1: direct link, hf CLI and curl.
- Browser
- Download file 811 Bytes
-
https://huggingface.co/spaces/nagasurendra/Dup_Chatbot1/resolve/main/utils.py
- Command line
-
hf download hf://spaces/nagasurendra/Dup_Chatbot1/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/nagasurendra/Dup_Chatbot1/resolve/main/utils.py
811 Bytes
| import requests | |
| def create_case_in_salesforce(message): | |
| # Example payload for creating a Case record in Salesforce | |
| case_data = { | |
| "subject": "Customer Inquiry from Chatbot", | |
| "description": message, | |
| "status": "New", | |
| "priority": "Medium", | |
| "origin": "Web Chat", | |
| } | |
| # Send POST request to Salesforce API to create a Case record | |
| response = requests.post( | |
| "https://your_instance.salesforce.com/services/data/vXX.0/sobjects/Case/", | |
| headers={ | |
| "Authorization": f"Bearer {SALESFORCE_API_KEY}", | |
| "Content-Type": "application/json", | |
| }, | |
| json=case_data, | |
| ) | |
| if response.status_code == 201: | |
| print("Case created successfully!") | |
| else: | |
| print("Failed to create case:", response.text) | |