Symptom
Many users ask about how to call the PowerServer REST APIs from another application to implement CRUD operations based on the DataWindows.
Environment
PowerServer 2021 or above
Cause
The CRUD APIs related to the DataWindows in a PowerServer C# WebAPI project is used internally by the PowerServer solution. The data format used to exchanges data with desktop cloud app is exclusive to PowerServer and is not suitable for other application calls.
Resolution
It’s recommended that you create a separate Web API project from your existing PowerBuilder DataWindows. There is a tutorial demonstrates how to do this:
https://docs.appeon.com/dwconverter2021/CRUD_Operations_with_Generic_.NET_DataStore/index.html
More tutorials and tech resources on this topic at the bottom of this page:
https://www.appeon.com/products/powerbuilder/dotnet-datastore-rest-apis
Elevate sessions on this topic:
https://www.youtube.com/playlist?list=PL2Eo5uXB4T3nendKrWoSmPeX92U8JbgyP
Tip: Do not reuse the C# Models generated in the PowerServer WebAPI project.
PowerServer C# WebAPI project is used internally by the PowerServer solution. If you use DataWindow Converter, you will see many options are checked by default (https://docs.appeon.com/dwconverter2021/Working_with_DataWindow_Converter/index.html#setting-global-options). PowerServer only uses a few necessary options. Many attribtues (such as DwSort, DwFilter, RequiredAttribute) are not generated from the DataWindows because PB Desktop Cloud App already handles these sort, filter, and checks required logic.
So it is recommended that you use the DataWindow Converter to generate the Models using the options that match your application requirements.