Recent searches
No recent searches
PowerAutomate JSON Failure
Answered
Posted Feb 21, 2024
Hello, wondering if anybody else has ran into this issue.
We run a Power Automate flow to change the Requestor field (in Zendesk) to the user that submits a Sharepoint form. Without it, the ticket would have the Requestor as No Reply-Sharepoint
It worked for a while, but we are now getting a "The response is not in a JSON format." error. The detailed error message says the Request Header is too long.
Microsoft's trigger is sending the request with a specific header value, I think Set-Cookie, and I'm wondering if it is too long for Zendesk.
Any thoughts?
0
1
1 comment
Brandon Tidd
The error "The response is not in a JSON format" accompanied by a detail about the "Request Header is too long" suggests a problem with the way the HTTP request is being sent from your Power Automate flow to Zendesk. The issue with the "Set-Cookie" header being too long for Zendesk could indeed be the root cause, as web servers and applications have limits on the size of headers they can process. Here are some steps and considerations to troubleshoot and potentially resolve this issue:
1. **Review and Minimize Headers**
- **Minimize Headers**: Check the configuration of your Power Automate flow to ensure it's only sending necessary headers. Unnecessary headers, especially cookies that can grow in size due to session data, should be removed if they're not required for the API request to succeed.
- **Check for Redundancies**: Ensure that your flow is not accumulating cookies or other header data with each request, which could grow over time and eventually exceed Zendesk's header size limit.
2. **Inspect the Request**
- **Debug the Flow**: Use Power Automate's built-in debugging tools to inspect the HTTP request being sent. Look specifically at the headers to identify any that are unexpectedly large.
- **Manual Request Test**: Try making a manual API request to Zendesk (using a tool like Postman or a cURL command) mimicking the one from Power Automate but with minimized headers. This can help determine if the issue is with the specific headers Power Automate is sending.
3. **Adjust the Power Automate Flow**
- **Customize the HTTP Request**: If possible, customize the HTTP request in Power Automate to exclude unnecessary headers or cookies. This might involve using a custom connector or adjusting the HTTP action's advanced options.
4. **Consult Zendesk Limits**
- **Zendesk Limits**: Check Zendesk's documentation or support resources to find specific limits on header sizes. Knowing the exact limit can help in ensuring your requests stay below this threshold.
5. **Workaround Strategies**
- **Use a Middleware**: If the issue persists and cannot be resolved by modifying headers directly, consider using a middleware solution (like Azure Functions or an AWS Lambda function) to act as a proxy. This middleware can receive requests from Power Automate, strip unnecessary headers, and then forward the request to Zendesk.
6. **Reauthentication**
- **Session Cookies**: If the "Set-Cookie" header relates to authentication, ensure your flow is correctly handling reauthentication. Accumulation of session data might be avoided by refreshing authentication tokens or sessions as needed, rather than relying on session cookies that could grow with each request.
By systematically addressing these areas, you should be able to identify and resolve the issue causing the "Request Header is too long" error in your Power Automate flow when updating the Requestor field in Zendesk tickets via SharePoint form submissions.
0