Hello Zoho Community,
I'm reaching out for assistance with an issue I've encountered while trying to integrate Zoho with HubSpot using a webhook trigger. Despite following documentation and trying various configurations, I consistently encounter an "Error 415 Unsupported Media Type" when making a POST request to a HubSpot webhook URL from Zoho Deluge.
Here's a detailed look at the attempts I've made, including the exact scripts used and the errors encountered:
First Attempt:
Objective: Trigger a HubSpot workflow via a webhook trigger with a JSON body.
Method: Passed parameters as a map directly in Deluge.
param = Map();
param.put("text", "hello world");
forward_ticket_info = invokeurl
[
type :POST
parameters:param
];
Error Received: HTTP ERROR 415 Unsupported Media Type.
Second Attempt:
Method: Attempted passing parameters as a JSON string in Deluge.
param = Map();
param.put("text", "hello world");
jsonString = param.toString(); // Assuming conversion to JSON string
forward_ticket_info = invokeurl
[
type :POST
parameters:jsonString
];
Error Received: HTTP ERROR 415 Unsupported Media Type.
Note: This snippet assumes an attempt to convert the map to a JSON string. Deluge script may require a specific method to correctly serialize the map to a JSON string format.
Third Attempt:
Method: Explicitly setting the Content-Type header to application/json in Deluge.
param = Map();
param.put("text", "hello world");
head = Map();
head.put("Content-Type", "application/json");
forward_ticket_info = invokeurl
[
type :POST
parameters:param
headers: head
];
Error Received: HTTP ERROR 415 Unsupported Media Type.
For comparison, executing a similar request with a raw JSON body format in Postman triggers the webhook successfully. This discrepancy suggests the issue may lie in how Deluge formats or sends JSON bodies and headers.
Given these attempts and the persistent error, I suspect there may be specific requirements for JSON bodies and headers in Deluge that I am not aware of, or there might be a limitation or bug affecting this integration.
I would greatly appreciate any insights, guidance, or suggestions on:
- The correct method to format and send JSON bodies in POST requests from Deluge to external webhooks.
- Any specific headers or configurations required to ensure the content type is correctly recognized.
- Known issues or limitations with Deluge's invokeurl method that might be relevant to this issue.
Your support in this matter is immensely appreciated, as it is crucial for our integration project. Looking forward to any advice the community can offer.
Best regards,
Lars