Open Visual Studio 2022, and click 'Create a new project'. Search for Console, and select the Console app project with C# as the main programming language.
2
Install client nuget package
In your new project, install the Struct.App.Api.Client NuGet package.
Or go to 'Tools' > 'NuGet Package Manager' > 'Manage NuGet Packages for Solution'. In the NuGet Package Manager, click on 'Browse', search for Struct.App.Api.Client, and install the latest version.
Ensure you select the correct project on the right before installing the package.
3
Install model nuget package
To finalize the installation process, you need to install the Struct.App.Api.Models. You can do this by entering the following command in a terminal window within Visual Studio 2022:
You will need to provide the URL to your PIM and the API key you created earlier.
Warning!Your API key should be kept secret. Do not push any of the code you create in this guide to any public version control providers (eg Github, GitLab etc).
5
Create instance of ApiService inside Program.cs
Lastly, create an instance of ApiService inside the Main(string[] args) method inside the Program class. You will gain access to invoke methods within the ApiService.
usingStruct.App.Api.Client;namespaceStruct.App.Api.Demo{publicclassProgram{staticvoidMain(string[]args){ApiServiceservice=newApiService(); // You can now invoke methods inside the ApiService instance.}}}
You're now ready to begin experimenting with the API through your ApiService instance. We recommend that you create methods inside the ApiService class which you then invoke through the Main(string[] args) method, inside the Program class.