Share via

Dynamics API is broken

ADPear Admin 21 Reputation points
2021-12-14T23:16:00.75+00:00

Hello, Our system is an Java application which integrates with Dynamics CRM, in the last few years we havent made any change, from last week, the following API is broken. I have two issues. **First issue,** since we havent made any change, but the API is broken, I believe Dynamics must have made some change on their end.

String url = "https://{client name}.crm.dynamics.com/api/data/v9.1.0.6228/z2t_models?fetchXml=<fetch version="1.0" output-format="xml-platform" count = "5000" page="1"><entity name="z2t_model"><attribute name="z2t_modelid" /><attribute name="z2t_machinekind" /><attribute name="z2t_name" /></entity></fetch>";
restTemplate.exchange(url, HttpMethod.GET, entity, String.class);

The API returns 500 internal error, the error message of response:

{"error":{"code":"0x0","message":"Unexpected character encountered while parsing value: \ufffd. Path '', line 0, position 0."}}

But I can call this API successfully using postman, it isn`t helpful from the error message. I am wondering what change I should make in order to call this API successfully.

Second issue: I made some change, removed the parameters from original url, and sent the parameters in the exchange method, for example,

String url = "https://{client name}.crm.dynamics.com/api/data/v9.1.0.6228/z2t_models";
String param = "<fetch version="1.0" output-format="xml-platform" count = "5000" page="1"><entity name="z2t_model"><attribute name="z2t_modelid" /><attribute name="z2t_machinekind" /><attribute name="z2t_name" /></entity></fetch>";
Map<String, String> params = new HashMap<>();
params.put("fetchXml", param);
restTemplate.exchange(url, HttpMethod.GET, entity, String.class, params);

It returns 200, but it returns a lot more information in response body which will causes out of memory issue on our end.

I will appreciate any help here, thanks!

Community Center | Not monitored
0 comments No comments

Answer accepted by question author

Anonymous
2021-12-14T23:22:37.613+00:00

Dynamics 365 is not currently supported here on Q&A. The product group for Dynamics actively monitors questions over at
https://community.dynamics.com/f

--please don't forget to upvote and Accept as answer if the reply is helpful--

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.