I am having a very strange issue with the web api when making http 'GET' calls to retrieve dynamics Account Entities. I am attempting to make JavaScript XMLHttp Requests from an html web resource inside dynamics.
As per the Documentation, I am making api calls to retrieve an Account with this uri:
GET [Organization URI]/api/data/v8.2/accounts(00000000-0000-0000-0000-000000000001)
This works for some accounts, but for other accounts i receive an empty response " {} " from other accounts.
However, the strange thing is I will get a correct response from some of the failed accounts when I slightly
alter the format of the api call. There are 3 things that I have noticed that I can do that will cause these calls
to return data:
1) change the api version
Example:
[Organization URI]/api/data/v8.2/accounts(49DAAE84-C747-E711-810D-FC15B4286C00)
will return "{}"
when [Organization URI]/api/data/v8.1/accounts(49DAAE84-c747-E711-810D-FC15B4286C00)
returns the correct acocunt data.
2) Add a space in between the parenthesis and the account GUID
Example:
[Organization URI]/api/data/v8.2/accounts(49DAAE84-C747-E711-810D-FC15B4286C00) returns "{}"
But
[Organization URI]/api/data/v8.2/accounts(49DAAE84-C747-E711-810D-FC15B4286C00%20) returns the correct account data
3) Make one (or more) letter(s) of the GUID lower case
Example:
change
/api/data/v8.2/accounts(49DAAE84-C747-E711-810D-FC15B4286C00)
to
/api/data/v8.2/accounts(49DAAE84-c747-e711-810D-FC15B4286C00)
This is a very strange problem, and at this point I would be fine with it if the error was at least consistent, but I can't find any way of encoding the uri so that it will always return
the account information. Has anyone ran into this problem before? Any insight is much appreciated.