Updating the Version One Rest API query to include Need totals using legacy SDK code

162 Views Asked by At

We have been building and loading the data using the .NET SDK for Version One. The rest-query seems to work fine with setting the selection fields, filters and the paging. An example of the rest query which is being built in the .Net solution is:

rest-1.v1/Data/Scope?sel=Key,Name,AssetState,Status.Name&where=ParentAndUp.Name='filter_1','filter_2'&page=3000,0

We have been able to query the assets for specific attributes using filtering and paging. The Version One documentation is extensive and the resource I have used to build the solution is:

https://community.versionone.com/Digital.ai_Agility_Integrations/Developer_Library/Get_an_SDK/.NET_SDK/Querying_Assets

Now with a recent environment update, the REST call seems to fail with an error saying Input structure is incorrect. Patch notes mention including the needTotal boolean field in the query since it is disabled by default. So would need to restructure the query to:

rest-1.v1/Data/Scope?sel=Key,Name,AssetState,Status.Name&where=ParentAndUp.Name='filter_1','filter_2'&page=3000,0&needTotal=true

I have had no luck finding any documentation or notes for including the field and building the code using the .NET SDK. Anyone who has run into a similar issue or might know something would be a great help.

1

There are 1 best solutions below

0
spazmodius On

Unfortunately, this API breaking change was not accompanied by updates to the SDKs.

To revert to the old API behavior (so that needTotal=true is the default, you can add this to the user.config:

<appSettings>
  <add  key="ApiDefaultNeedTotal" value="true" />
</appSettings>