How to use the APIWindowsClient solutionOnce you have confirmed the API is up and you can return sites from your browser, you can use the APIWindowsClient solution to test and make calls to the API. On your development machine - Unzip the APIWindowsClient solution and open this in Visual Studio.
- Open the APIClientFactory.cs class
- In the CreateNew method, change the BaseUrl to match your machine name and port of your web service.
- Once completed, go to Build and then Build Solution. This will output the .exe file into the output folder
TIP: To find the output folder, right click on the APIWindowsClient in Solution Explorer then choose Open Folder in Explorer Window. The exe will be inside bin/Debug. On your target machineYou can now run the new client on this machine. The form will look like this: Clicking on Get Sites will return all companies the currently logged on Sage 200 User will have access to. Clicking on Get Departments will return all departments for the companies the currently logged on Sage 200 User will have access to. Using the Windows form, you can also POST requests to your Sage 200 data using the Post Dept button. The number in the bottom right hand box will be the Department code that is created. You can use this form as a base for any in house API development work using Windows Forms. Next StepsIf you wish to make use of the APIWebSiteWindows solution, please follow the steps in this article. If you wish to make use of the APIWebSiteAnon solution, please follow the steps in this article. |