Steps to reproduce
- Make a GET request to
api.businesscentral.dynamics.com/.../companies
(works) - Add a url-encoded # anywhere after "api/"
api.businesscentral.dynamics.com/.../c#ompanies
fails with error code 'Authentication_InvalidCredentials'. Message 'The server has rejected the client credentials. CorrelationId: ...'
(it worked before, so it is not due to invalid credentials)
Using a raw hash (not URL-encoded), results in an error: BadRequest_NotFound "Bad Request - Error in query syntax."
The response is the same for both custom APIs and the v2.0 API.
Why do I need a hash in the url?
We are trying to update the 'Manufacturer Code' field of an item. That field is not in the v2.0 Microsoft API, so we use a custom API, where an item is identified by the 'No' field. To update the manufacturer code of an item, I use OData and call:
PATCH api.businesscentral.dynamics.com/.../Items(No='...')
Many of our items contain # in their item number (No).
Any help or alternative solution is welcome.