Question

Using & in API/endpoint request

  • 14 October 2022
  • 3 replies
  • 147 views

Userlevel 1

Hi,  

Trying to get customer data out via API request and am having an issue when the key data I’m including has an &.  Specifically trying to get customer and/or customer contact information and the endpoint for customer works fine for IDs with no special character, but a bunch of customers on this implementation have an & in the customer code and when I execute the same command via postman using those customer IDs an error is returned.  I did some digging and did try a few workarounds, etc. I found on the web most involving using %26 in place of the &, but everything I’ve seen on the web I’ve tried and still get the same error returned.  Has anyone encountered this and is there workaround or specific syntax I need to use?  Thanks, pasting the URL, just using the ‘base’ endpoint that comes with the system, engaging the customer endpoint (and eventually contact information as well).

 

Works fine and customer data is returned
 

 

Returns errors
 

 


3 replies

Userlevel 3
Badge +2

You might want to use the filter parameter instead of putting the value directly in the URL.

Due to the way it is being parsed, the & symbol in the URL gets used as a delimiter instead of part of the value.

Here is an example of how it could work

{{BaseUrl}}/entity/Default/22.200.001/Customer?$filter=CustomerID eq 'CB%26F010'

Userlevel 1

Thanks, actually in my troubleshooting with Postman, I did notice that if I applied the customer id as a filter, it did work with the &.  I was just wondering/hoping that with the url as currently constructed, there was some syntax I could use to make the & work and as i said, I have tried a few variations I found online and none seemed to work.  Thanks for the reply

Userlevel 7
Badge

Hi @rskieresz88 have you been able to find a resolution? Thank you!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved