pwitab / visma

A Python Client library for integration to Visma eAccounting, Visma eEkonomi
http://visma.readthedocs.io
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

URL encoding of query parameters failing. #8

Closed Krolken closed 5 years ago

Krolken commented 6 years ago

Have opened an issue with the Visma API Team about the API not accepting URL encoding of query parameters.

In the work of enabling filtering, ordering and pagination support we need to send query parameters in the Odata format to the Visma API. When doing this it seems we get an error in the parsing of the query parameters that are being URL encoded by the requests package. both problem with + and %20

GET: 'https://eaccountingapi-sandbox.test.vismaonline.com/v2/customers?$filter=Id%20eq%20%2291ff2390-968b-4ef7-877d-dd7aef616ae4%22'

{"ErrorCode":6000,"DeveloperErrorMessage":"QueryParameterException - Syntax error: character \\'\\"\\' is not valid at position 6 in \\'Id eq \\"91ff2390-968b-4ef7-877d-dd7aef616ae4\\"\\'.","ErrorId":"9cfb7373-af6e-4611-92eb-8860db42a9b3"}

Waiting for response

Krolken commented 6 years ago

I figured out that it was me using " instead of ' that triggered the syntax error. But then I encountered another problem on the visma API. They cannot compare a GUID against a string.

So need to build handling of that.