Chris_Carr | 2022-12-09 12:49:56 UTC | #1
We have an issue with a data action that responds stating that the third party is not including a valid Content-Type header which should be application/json. Please see the below.
REST call for action execute failed. Message: Response from third party did not include a valid Content-Type header including 'application/json'. Returned Content-Type: text/javascript; charset=utf-8 Response from web service: {"delivery_points":[{"organisation_name":"","department_name":"","line_1":"24 GREYHOUND HILL","line_2":"","udprn":"17708604","dps":"1B"},{"organisation_name":"","department_name":"","line_1":"26 GREYHOUND HILL","line_2":"","udprn":"17708605","dps":"1D"},{"organisation_name":"","department_name":"","line_1":"28 GREYHOUND HILL","line_2":"","udprn":"17708606","dps":"1E"},{"organisation_name":"","department_name":"","line_1":"30 GREYHOUND HILL","line_2":"","udprn":"17708607","dps":"1F"},{"organisation_name":"","department_name":"","line_1":"32 GREYHOUND HILL","line_2":"","udprn":"17708608","dps":"1G"},{"organisation_name":"","department_name":"","line_1":"34 GREYHOUND HILL","line_2":"","udprn":"17708609","dps":"1H"},{"organisation_name":"","department_name":"","line_1":"36 GREYHOUND HILL","line_2":"","udprn":"17708610","dps":"1J"},{"organisation_name":"","department_name":"","line_1":"40 GREYHOUND HILL","line_2":"","udprn":"17708612","dps":"1N"},{"organisation_name":"","department_name":"","line_1":"42 GREYHOUND <Limit of 1024 characters displayed> [6151fa85-d418-40a7-8d98-079a41bd20ec]
I think that there might be an issue with this action because when I run this endpoint in Postman it works. The other thing to note from the above is that the JSON response is there after the error. The action appears to think that the returned header is text/javascript.
Any assistance to resolve this will be appreciated.
Here is a screenshot of the error
Thank you.
Jerome.Saint-Marc | 2022-12-09 13:11:28 UTC | #2
Hello,
It is not about the response body but an HTTP Header (in response). The traces you have included state that the web server (3rd party) has replied with an HTTP Content-Type header set to "text/javascript". The server has to include Content-Type: "application/json" in its response.
-> REST call for action execute failed. Message: Response from third party did not include a valid Content-Type header including 'application/json'. Returned Content-Type: text/javascript; charset=utf-8
Regards,
Chris_Carr | 2022-12-09 13:57:21 UTC | #3
Jerome.Saint-Marc, post:2, topic:17586
It is not about the response body but an HTTP Header (in response). The traces you have included state that the web server (3rd party) has replied with an HTTP Content-Type header set to "text/javascript". The server has to include Content-Type: "application/json" in its response.
-> REST call for action execute failed. Message: Response from third party did not include a valid Content-Type header including 'application/json'. Returned Content-Type: text/javascript; charset=utf-8
Thank you very much, I thought as much and have raised it with the 3rd party. Appreciate the response.
Jerome.Saint-Marc | 2022-12-09 15:06:58 UTC | #4
In your Data Action Request Configuration, you may also set the Content-Type header (set to application/json). Just to make sure Genesys Cloud is sending it in your HTTP Request.
Regards,
Chris_Carr | 2022-12-09 15:19:29 UTC | #5
I have tried that already and I receive the same response. I am wondering if something changed with the 3rd party as it used to work as expected until now.
system | 2023-01-09 15:20:15 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 17586