OData Version 4.0 Changes in Acumatica 24R1
Hello everybody,
Today, I want to share with you a few differences between the previous version of OData and the new version, ODataV4. But before we dive in, let's set up our Postman environment to test it together. The first step is to create environment variables in Postman.
After creating these variables, go to the Authorization tab, choose the 'Basic Auth' authorization method, and set the corresponding variables for username and password.
A request for $metadata returns an additional attribute, Scale="Variable", for Edm.Decimal types, as shown in the following example. <Property Name="ControlAmount" Type="Edm.Decimal" Nullable="false" Scale="Variable"/>
When a $metadata request is made with the $format=json parameter specified, it now returns an error. In earlier versions, this parameter was ignored and XML was provided instead
If the response code is 404 Not Found, the response body will be empty.
If a request is made using an unsupported HTTP method (like POST, PUT, or DELETE), it will now return a 405 Method Not Allowed response instead of the previous 404 Not Found.
Now, a request that includes an invalid OData-Version header, like 6.0, will return a 400 Bad Request response instead of the earlier 404 Not Found.
"When a request for full metadata is made, as shown in the example below, the value of @odata.id differs from what was returned in previous versions.
The updated value now incorporates the full path to the service, like '@odata.id': '' http://localhost/Acumatica24R1Pre/odatav4/SOSetup"
In earlier versions, when a client made a $value request (like the example below) without specifying the Accept-Charset header, the UTF-8 BOM (byte order mark) was included in the response. However, in the current version, the UTF-8 BOM is no longer added.